Skip to content

fix: prevent duplicate CLI flags in buildAgentArgs#399

Merged
pedramamini merged 2 commits intoRunMaestro:mainfrom
jeffscottward:fix/398-codex-duplicate-flags-main
Feb 17, 2026
Merged

fix: prevent duplicate CLI flags in buildAgentArgs#399
pedramamini merged 2 commits intoRunMaestro:mainfrom
jeffscottward:fix/398-codex-duplicate-flags-main

Conversation

@jeffscottward
Copy link
Copy Markdown
Contributor

@jeffscottward jeffscottward commented Feb 17, 2026

Summary

  • deduplicate repeated flag-style args in buildAgentArgs() while preserving order
  • only deduplicate flags (-/--), leaving positional args unchanged
  • add regression tests for the Codex duplicate bypass flag case and positional-arg safety

Why

When both batch mode and YOLO mode contribute the same flag (for example Codex --dangerously-bypass-approvals-and-sandbox), the final argv can contain duplicates and Codex exits with code 2.

Fixes #398

Follow-up Fix (Wizard/Codex)

  • fix wizard conversation output selection for Codex when multiple agent_message events occur in one turn
  • keep the latest Codex result text and emit at turn completion instead of taking the first interim message
  • add regression test in StdoutHandler.test.ts to ensure only the final Codex message is emitted

This addresses cases where Wizard got stuck showing interim text like "I’m checking the directory..." instead of the actual final answer.

@jeffscottward
Copy link
Copy Markdown
Contributor Author

jeffscottward commented Feb 17, 2026

@pedramamini switch to CodeRabbit? https://www.coderabbit.ai/pricing

OIDC error on claude review. Config error?

@jeffscottward
Copy link
Copy Markdown
Contributor Author

jeffscottward commented Feb 17, 2026

Added follow-up commit for Wizard/Codex behavior:

  • ensure Codex multi-message turns emit the final response (not interim "I’m checking...")
  • added regression test coverage in StdoutHandler tests

Commit: 2fa8dd2

@pedramamini pedramamini merged commit 3f7f03b into RunMaestro:main Feb 17, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] in [Wizard] using [CODEX]: "the argument '--dangerously-bypass-approvals-and-sandbox' cannot be used multiple times"

2 participants