fix(app): keep tracking auto-approve prompts that land while scrolled back - #86
Conversation
… back A prompt drawn while the viewport was scrolled back was dropped by the ViewportNotLive suppression, and a wheel scroll back to the live rows produces no pty output to rescan on, so the prompt was never approved until the agent redrew. Codex's inline UI makes this common. - Scan the live tail rows instead of the scrolled viewport and treat ViewportNotLive like the input cooldown: keep the match tracked and let the 350 ms stability rescan poll until the viewport is live again. Firing still requires two unsuppressed matches at offset 0. - Make the Codex `Environment:` row optional (codex 0.154 omits it without a selected environment) and accept the cross-thread footer. - Add NOA_AUTO_APPROVE_TRACE=1 to log decisions and main-thread rejects. Claude-Session: https://claude.ai/code/session_01Nzt9w133uttk9d1FjUUJ2G
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4dbe4593e3
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !context.iter().any(|row| { | ||
| row.trim() | ||
| .strip_prefix("$ ") | ||
| .is_some_and(|command| !command.trim().is_empty()) | ||
| }) { |
There was a problem hiding this comment.
Preserve the local-environment guard when making it optional
When a Codex dialog contains Environment: <non-local>, this condition now accepts it as long as a $ command is present and automatically sends Enter. The documented recognition matrix still limits this signature to Environment: local (docs/specs/auto-approve-mode.md:50), and the stated compatibility case only requires accepting dialogs where the row is absent for a plain local run. Reject a present Environment: row unless its value is local, while continuing to allow the row to be omitted, so auto-approve cannot execute commands in an unintended selected environment.
Useful? React with 👍 / 👎.
Summary
Suppressed(ViewportNotLive), which dropped the tracked match. Scrolling back to the live rows produces no pty output, so nothing rescanned and the prompt sat unapproved until the agent redrew. Codex's inline UI makes this common.ViewportNotLivelike the input cooldown: the match stays tracked and the 350 ms stability rescan polls until the viewport returns to offset 0. Firing still requires two unsuppressed matches at offset 0 (FR-5 / AC-6 unchanged).Environment:row is optional (codex 0.154 omits it without a selected environment); the cross-thread footer… or o to open threadis accepted.NOA_AUTO_APPROVE_TRACE=1logs every tracked decision and main-thread reject reason to stderr.docs/specs/auto-approve-mode.md.Verification
cargo test -p noa-app: 1238 passed (+5 tests: real codex 0.154 capture replayed through the VT grid, scrolled-back re-arm, live-row reader, no-Environment:layout, screenshot layout with wideReason:).cargo fmt --check,cargo clippy -p noa-app --all-targets(warnings identical to main).-a on-request -s read-only, oracle =mkdiractually running):https://claude.ai/code/session_01Nzt9w133uttk9d1FjUUJ2G