Skip to content

fix(app): let codex approval prompts settle before auto-approving - #90

Merged
simota merged 1 commit into
mainfrom
fix/codex-auto-approve-settle
Sep 24, 2026
Merged

simota merged 1 commit into
mainfrom
fix/codex-auto-approve-settle

Conversation

@simota

@simota simota commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Codex could leave a command-approval prompt unanswered even though auto-approve had fired: NOA_AUTO_APPROVE_TRACE=1 logged sent CodexCommand to "codex", but the command did not run. Codex 0.156.1 ignores an Enter that arrives immediately after its approval modal first appears. Noa fires on the second consecutive match, which can arrive milliseconds after the first paint when codex draws follow-up frames. Noa then treated the ignored prompt as consumed and never retried it.

Add a per-signature settle delay. Codex prompts now wait until they have been on screen for 300ms, and the existing 350ms stability rescan fires once they settle. Claude Code and agy signatures still fire on the second match.

Validation:

  • Driving codex 0.156.1 directly through a pty: Enter sent 0ms after the modal first appeared was ignored in 2 of 2 runs, and Enter sent after 100ms or 400ms was accepted.
  • Reproduced "sent but ignored" in a GUI E2E run on v0.2.18 (split pane). The codex session log showed the command ran only after a manual y, about 3 minutes later.
  • With the fix, a GUI E2E run held the prompt for 4 scans, then fired, and codex ran the command.
  • A new regression test, codex_prompt_waits_for_settle_before_firing, covers the settle window. Existing codex tests now advance time past the settle delay.
  • cargo test -p noa-app: 1240 passed, 0 failed.
  • cargo clippy -p noa-app --all-targets: no new warnings. The only warnings are pre-existing ones in text_panel.rs and noa-pty.
  • rustfmt --check on the changed file.

The user's original report has not been confirmed to be this failure mode. On recurrence, the diagnostics from NOA_AUTO_APPROVE_TRACE=1 would distinguish "sent but ignored" from "never detected". The 300ms threshold was measured against codex 0.156.1 and may need revisiting if codex changes.

Codex 0.156.1 drops an Enter that lands right after its approval modal's
first paint. Noa fired on the second consecutive match, which can come
milliseconds later, and then treated the ignored prompt as consumed, so it
sat unanswered. Hold codex prompts until they have been on screen for
300ms; the stability rescan fires once they settle.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T23:29:04.385417Z c75d169 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@simota
simota merged commit 08e9d80 into main Sep 24, 2026
1 check passed
@simota
simota deleted the fix/codex-auto-approve-settle branch September 24, 2026 23:31
@simota simota mentioned this pull request Sep 24, 2026
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.

1 participant