Skip to content

Fix: stop recording Codex commands that mention a rejection as interrupted - #200

Open
aayank13 wants to merge 1 commit into
mainfrom
fix/codex-rejection-output
Open

aayank13 wants to merge 1 commit into
mainfrom
fix/codex-rejection-output

Conversation

@aayank13

Copy link
Copy Markdown
Owner

Fixes #172

The Codex parser marked a tool call as interrupted whenever its output contained "rejected by user" or "aborted by user" anywhere, and it checked that before reading the exit code header. So a passing npm test whose mocha output listed "returns 403 when the upload is rejected by user", or an rg -n 'rejected by user' src that exited 0, was recorded as interrupted. When that command was the task's check, the task was thrown away with "no check ran after the last edit".

Codex writes these markers in a fixed shape, and never next to a command's real output. A declined approval becomes ToolError::Rejected("rejected by user"), which Codex normalizes to exec command rejected by user or patch rejected by user, and that string is the whole tool output, with no exec header. A call the user aborts gets Wall time: 4.2 seconds\naborted by user for exec_command and aborted by user after 2.5s for every other tool. The parser now matches exactly these outputs and nothing else, so any output that carries an exit code keeps it.

Other rejections Codex sends through the same path, such as the automatic approval reviewer's denial, are left as they were. They are not user interruptions and were never matched before either.

To reproduce, I fed trodden ingest --agent codex --ended a rollout with an apply_patch to src/upload.js followed by npm test exiting 0 with the mocha output above, using a scratch TRODDEN_HOME. Before the fix the task was rejected with "no check ran after the last edit". After it, the same rollout learns a procedure: edit src/upload.js, then check with npm test.

New tests cover passing and failing commands whose output mentions a rejection or an abort keeping their exit code (this one fails on the old matcher), and each of Codex's real rejection and abort outputs still being recorded as interrupted.

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.

Codex: a command whose output contains "rejected by user" is recorded as interrupted

1 participant