diff --git a/README.md b/README.md index 9134872..cb65b6f 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,8 @@ Useful flags: - `--once` run one polling cycle and exit - `--retry-failed` retry failed PRs without waiting for a new head SHA +Note: the monitor dispatches Codex through explicit `--task/--agent/--base` flags for compatibility with both older and newer `scripts/codex-agent.sh` argument parsing. + ## Important behavior defaults - No command defaults to `gx status`. diff --git a/scripts/review-bot-watch.sh b/scripts/review-bot-watch.sh index a41cefd..dd43e5d 100755 --- a/scripts/review-bot-watch.sh +++ b/scripts/review-bot-watch.sh @@ -262,7 +262,11 @@ process_one_pr() { echo "[review-bot-watch] Dispatching Codex agent for PR #${pr} (${head_branch})" set +e - bash "$repo_root/scripts/codex-agent.sh" "$task_name" "$AGENT_NAME" "$BASE_BRANCH" -- exec "$prompt" + bash "$repo_root/scripts/codex-agent.sh" \ + --task "$task_name" \ + --agent "$AGENT_NAME" \ + --base "$BASE_BRANCH" \ + -- exec "$prompt" local exit_code="$?" set -e diff --git a/templates/scripts/review-bot-watch.sh b/templates/scripts/review-bot-watch.sh index a41cefd..dd43e5d 100755 --- a/templates/scripts/review-bot-watch.sh +++ b/templates/scripts/review-bot-watch.sh @@ -262,7 +262,11 @@ process_one_pr() { echo "[review-bot-watch] Dispatching Codex agent for PR #${pr} (${head_branch})" set +e - bash "$repo_root/scripts/codex-agent.sh" "$task_name" "$AGENT_NAME" "$BASE_BRANCH" -- exec "$prompt" + bash "$repo_root/scripts/codex-agent.sh" \ + --task "$task_name" \ + --agent "$AGENT_NAME" \ + --base "$BASE_BRANCH" \ + -- exec "$prompt" local exit_code="$?" set -e diff --git a/test/install.test.js b/test/install.test.js index 96807de..bdaee80 100644 --- a/test/install.test.js +++ b/test/install.test.js @@ -293,6 +293,14 @@ test('review-bot-watch script prints help after setup', () => { assert.match(helpResult.stdout, /Continuously monitor GitHub pull requests targeting a base branch/); }); +test('review-bot-watch uses explicit codex-agent flags for argument parsing compatibility', () => { + const script = fs.readFileSync(path.resolve(__dirname, '..', 'scripts', 'review-bot-watch.sh'), 'utf8'); + assert.match(script, /--task \"\$task_name\"/); + assert.match(script, /--agent \"\$AGENT_NAME\"/); + assert.match(script, /--base \"\$BASE_BRANCH\"/); + assert.match(script, /-- exec \"\$prompt\"/); +}); + test('setup blocks in-place maintenance writes on protected main after initialization', () => { const repoDir = initRepoOnBranch('main');