Skip to content

fix(codex): match the 0.156+ folder-trust dialog in the prompt detector - #446

Merged
artempartos merged 1 commit into
developfrom
fix/codex-trust-prompt-signature
Oct 8, 2026
Merged

artempartos merged 1 commit into
developfrom
fix/codex-trust-prompt-signature

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

What

InteractivePromptDetector's codex_workspace_trust signature never matched the dialog that current Codex shows. When a non_interactive step was parked on the folder-trust dialog, the step was never failed: it sat at ready until it timed out, the failure that task #605 introduced this detector for.

Codex 0.156.0 replaced the old dialog in openai/codex#44732 and #46695. Our images have pinned 0.156.1 or newer since #303, so the old text no longer appears anywhere we run:

0.155 and earlier 0.156.0 and later
Question Do you trust the contents of this directory? Trust this folder? Codex can read, edit, and run files here, …
Options 1. Yes, continue / 2. No, quit 1. Trust and continue / 2. Quit (2. Back to Agent Command Center when the TUI runs on the background server)
Key hint Press enter to continue enter continue · esc quit (esc back on the background server)

Where the text comes from

  • A real capture: Codex 0.161.0 in an 80x24 detached tmux pane in aixle/codex (tmux capture-pane -p), both in-process and on the background server.
  • The CLI source: codex-rs/tui/src/onboarding/trust_directory.rs and its insta snapshots; the 0.156.1 and 0.161.0 snapshots are identical.
  • The official docs: checked as asked. The config basics, configuration reference and agent approvals & security pages describe only what trust does: project .codex/ layers load only in trusted projects, projects.<path>.trust_level records the choice, and a session may start read-only through an onboarding prompt. None of them quote the dialog, so the wording comes from the source and the capture.

Changes

  • Markers: the question and the first option label, which stay on one line at any pane width (including a 40-column snapshot).
  • Footer: the key hint (esc quit/esc back), or the last option when the pane is captured before the hint renders. It is anchored to the start of the line, so prose that quotes the phrases mid-sentence does not count.
  • Tests:
    • fixtures now come from the real 0.161.0 capture;
    • new cases cover the background-server variant and a narrow, wrapped pane, plus Codex's idle chat screen, which must not count as blocked;
    • the "whole dialog quoted, then agent keeps working" negative case now ends on Codex's real input box.
  • Comments and docs: comments that quoted the old prompt now quote "Trust this folder?", and the research doc has a dated update section with the new dialog and how to reproduce it.

Verification

  • Tests were not run locally; CI on this PR is the check.
  • The detector's matching logic was reproduced in Python and checked against 16 cases (8 that must detect, 8 that must not) and the raw capture.

Not covered

  • Restricted variant: a folder explicitly marked untrusted shows an "Open restricted" variant. It is left out deliberately, since we never mark the workspace untrusted.
  • A dialog split across output chunks: ScanQuotaErrorsActivity#live_terminal_output joins exec output chunks with "\n", so a chunk boundary in the middle of the footer line could hide the dialog for one sweep. This gap predates this change and is not touched here.

Related: #443 (CLI pin bump).

🤖 Generated with Claude Code

Codex 0.156.0 replaced "Do you trust the contents of this directory?" /
"Yes, continue" / "No, quit" with a "Folder access" dialog: "Trust this
folder?", "1. Trust and continue", "2. Quit" (or "Back to Agent Command
Center" when the TUI runs on the background server) and the hint
"enter continue · esc quit|back". The codex_workspace_trust signature
still keyed on the old text, so a non_interactive session parked on the
dialog was never failed. The images have pinned 0.156.1 or newer since
#303, so the old wording is dropped rather than kept alongside.

Markers are the question and the first option label, which stay on one
line at any pane width; the footer is the key hint or the final option.
Fixtures come from a real 0.161.0 tmux capture and the CLI's insta
snapshots.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit 5121fad into develop Oct 8, 2026
8 checks passed
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