From 4b73ec8417e3d19dce4f7cbcb918232991d0fb07 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Fri, 16 Oct 2026 01:42:40 +0200 Subject: [PATCH] fix(#624): read codex's trust prompt as BLOCKED when it ends in esc back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On codex-cli 0.162.0, with 0.163.0 released, every launch first shows the "Update available" prompt, and choosing Skip leads to a variant of the workspace trust prompt: "2. Back to Agent Command Center" over the key-hint row "enter continue · esc back". The pattern only accepted cancel, interrupt, quit, answer or all as the closing word, so a fresh git repo launched from Codeman sat on that trust prompt reading idle, with no red alert and no blocked signal (measured live on a throwaway instance). Adding "back" is safe because the hint row must still START with one of the anchored hints ("enter continue" here): the popups the user opens at the keyboard (/model, /permissions, /review, Implement this plan?) end in "esc back" too, but their row starts with "enter select", so they stay unmatched, as every existing negative fixture confirms. The new fixture is the live capture with the scratch path replaced. Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/cli-registry.md | 7 ++++--- src/config/cli-registry/stock.ts | 4 +++- test/codex-blocked-detection.test.ts | 4 ++++ test/fixtures/codex-dialogs/trust-dialog-back.txt | 12 ++++++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 test/fixtures/codex-dialogs/trust-dialog-back.txt diff --git a/docs/cli-registry.md b/docs/cli-registry.md index 445bb43c..53343f05 100644 --- a/docs/cli-registry.md +++ b/docs/cli-registry.md @@ -142,9 +142,10 @@ with newlines and tested once (`isBlockedScreen()`, `session-activity.ts`), so i several markers and anchor the dialog's footer on the END of the window (no `m` flag: `$` is the last row). Codex's needs a `› N.` option row and then its key-hint row (`Press enter to confirm or esc to cancel`, `tab to add notes | enter to submit answer | esc to interrupt`, -`enter continue · esc quit` for the startup trust prompt), allowing for that row to wrap -onto rows of its own below about 60 columns. Measured on codex-cli 0.162.0 at widths 200 down -to 36: the command, edit and network-escalation approvals, single and multi-question +`enter continue · esc quit` for the startup trust prompt, `esc back` when it follows the +update prompt), allowing for that row to wrap onto rows of its own below about 60 columns. +Measured on codex-cli 0.162.0 at widths 200 down to 36: the command, edit and +network-escalation approvals, single and multi-question `request_user_input` dialogs (notes field open or closed), and the workspace trust prompt match; the idle and working views, popups the user opened (`/model`, `/permissions`, `/review`), the composer holding the dialogs' words and a transcript quoting them verbatim diff --git a/src/config/cli-registry/stock.ts b/src/config/cli-registry/stock.ts index 55933c7c..50e35d10 100644 --- a/src/config/cli-registry/stock.ts +++ b/src/config/cli-registry/stock.ts @@ -703,6 +703,8 @@ const CODEX: CliEntry = { // (its notes field open) ` tab or esc to clear notes | enter to submit answer` // workspace trust, at startup `› 1. Trust and continue` // ` enter continue · esc quit` + // (the same prompt reached after the ` 2. Back to Agent Command Center` + // update prompt, 0.162.0, 2026-10-16) ` enter continue · esc back` // The pattern needs both: a `› N.` option row, then the key-hint row, which must END // the window. Below about 60 columns that hint wraps onto rows of its own // (` Press enter to confirm or esc to` / ` cancel`, or `tab to add notes` / @@ -725,7 +727,7 @@ const CODEX: CliEntry = { workingLine: '[Ee]sc to interrupt', watchingLine: String.raw`^\s{0,4}(\d+ background terminals?) running · /ps to view · /stop to close$`, watchingLines: 4, - blockedLine: String.raw`(?:^|\n) {0,4}› \d\. [\s\S]*\n {2}(?:Press enter to confirm|tab (?:to add|or esc to clear) notes|enter continue)(?:[^\n]|\n {2}(?=[a-z←])){0,120}(?:cancel|interrupt|quit|answer|all)$`, + blockedLine: String.raw`(?:^|\n) {0,4}› \d\. [\s\S]*\n {2}(?:Press enter to confirm|tab (?:to add|or esc to clear) notes|enter continue)(?:[^\n]|\n {2}(?=[a-z←])){0,120}(?:cancel|interrupt|quit|back|answer|all)$`, blockedLines: 20, }, // The footer under the composer, measured on a live 0.147.0 pane: diff --git a/test/codex-blocked-detection.test.ts b/test/codex-blocked-detection.test.ts index 86addd6a..8d2d7697 100644 --- a/test/codex-blocked-detection.test.ts +++ b/test/codex-blocked-detection.test.ts @@ -59,6 +59,10 @@ const DIALOGS = [ 'question-notes-typed.txt', 'trust-dialog.txt', // drawn at the TOP of an otherwise blank screen at startup 'trust-dialog-w40.txt', + // The same prompt, reached through the update prompt (`2. Skip`) on 0.162.0 with 0.163.0 + // out: `2. Back to Agent Command Center` over `enter continue · esc back`. Captured + // 2026-10-16 from Codeman's own launch flags in a fresh git repo, at 120 columns. + 'trust-dialog-back.txt', ]; /** Screens with no dialog codex blocks on, several of them quoting the dialogs' words. */ diff --git a/test/fixtures/codex-dialogs/trust-dialog-back.txt b/test/fixtures/codex-dialogs/trust-dialog-back.txt new file mode 100644 index 00000000..70c5a3df --- /dev/null +++ b/test/fixtures/codex-dialogs/trust-dialog-back.txt @@ -0,0 +1,12 @@ + + Folder access + /tmp/codex-scratch/repo + + Trust this folder? Codex can read, edit, and run files here, subject to your permission settings. Folder settings + can run code automatically, even without a model request. Continue only if you trust these files. Your trust + decision will be saved. + +› 1. Trust and continue + 2. Back to Agent Command Center + + enter continue · esc back