Fix tool argument passing for flag-style arguments

- Change nargs="*" to REMAINDER for tool_args to stop argparse from
  intercepting --flag style arguments meant for the tool
- Add -- separator handling to distinguish cmdforge args from tool args
- Map flag names to variable names using tool argument definitions
- Update AI review subprocess calls to use -- separator

Fixes scrutiny-ai-review tool arguments not being passed correctly.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
rob
2026-01-16 16:39:36 -04:00
co-authored by Claude Opus 4.5
parent e1cae5ffda
commit 12ae870b3c
4 changed files with 37 additions and 15 deletions
+2 -2
View File
@@ -111,11 +111,11 @@ def run_ai_scrutiny_review(scrutiny_report: dict, config: dict, tool_name: str,
if not cmdforge_exe:
return None
# Run the tool
# Run the tool (use -- to separate cmdforge args from tool args)
try:
result = subprocess.run(
[
cmdforge_exe, "run", "scrutiny-ai-review",
cmdforge_exe, "run", "scrutiny-ai-review", "--",
"--warnings", json.dumps(warnings),
"--tool-config", json.dumps(tool_config),
],