Skip to content

test(send): launch codex doorbell e2e with --disable hooks - #7406

Merged
kunchenguid merged 1 commit into
kunchenguid:mainfrom
thelad-dev:fm/fm-doorbell-test-codex-hooks-20261016
Oct 16, 2026
Merged

kunchenguid merged 1 commit into
kunchenguid:mainfrom
thelad-dev:fm/fm-doorbell-test-codex-hooks-20261016

Conversation

@thelad-dev

@thelad-dev thelad-dev commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Der Live-Tuerklingel-Test startet codex nicht so, wie fm-spawn es startet - deshalb laesst sich die codex-Spur auf keinem Firstmate-Checkout nachweisen. Das wird korrigiert, und der Nachweis, um den Kun in PR 7362 gebeten hat, kommt damit mit.

Befund: tests/fm-send-inbox-doorbell-live-e2e.test.sh sagt im Kopf, jedes Programm werde gestartet "the way bin/fm-spawn.sh launches it". launch_cmd nutzt fuer codex aber nur 'codex --dangerously-bypass-approvals-and-sandbox', waehrend bin/fm-spawn.sh im crewmate/scout-Pfad zusaetzlich '--disable hooks' setzt. Der Grund steht dort im Kommentar und in references/harness/codex.md: der Hook-Vertrauensdialog ist mit der Tastenebene dieses Werkzeugs unbeantwortbar, die Auswahl startet auf "Review hooks" und es gibt keine Pfeilnavigation.

Dreifacher Live-Nachweis auf einer Maschine mit angemeldetem codex, jeweils gegen den Kopf 7c9306d aus PR 7362:

  1. Normale Konfiguration: codex parkt auf "Hooks need review - 4 hooks are new or changed", Ergebnis "doorbell not honored within 240s (acted=no acked=no)" - kein Urteil ueber die Tuerklingel, sondern ein Dialog.
  2. Konfigurationskopie ohne die Hook-Datei der Maschine: parkt auf den Projekt-Hooks des Repos selbst (.codex/hooks.json). Gleiche Folge. Die codex-Spur ist damit auf jedem Firstmate-Checkout unbeweisbar.
  3. Nur '--disable hooks' im Startrezept ergaenzt: "ok - codex (codex-cli 0.163.0): the doorbell reached a real worker, which acted and acked with the mv".

Damit ist auch die in PR 7362 erbetene Zusatzpruefung erledigt: codex-cli 0.163.0 befolgt die neue Tuerklingel-Formulierung.

What Changed

  • Align the live inbox doorbell e2e codex launch recipe with bin/fm-spawn.sh by adding --disable hooks, so the check judges the doorbell instead of parking on Codex's hook-trust modal.
  • Add a hard assertion that the codex launch recipe still contains --disable hooks, failing fast if the flag is dropped again.

Risk Assessment

✅ Low: Single-file test fix aligns the codex live doorbell launch with the existing crewmate spawn recipe and adds a local recipe pin; no production code or behavior change beyond the intended harness flags.

Nachweis zum Live-Lauf

Der vollständige Live-Lauf ist nicht in dieser Pipeline gelaufen, sondern auf einem separaten Rechner mit angemeldetem codex, gegen den Kopf 7c9306d aus #7362. Die Ergebniszeile dort:

ok - codex (codex-cli 0.163.0): the doorbell reached a real worker, which acted and acked with the mv

Davor zwei Läufe auf demselben Rechner ohne --disable hooks, die beide auf dem Hook-Dialog parkten: einmal auf den Hooks der Maschine, nach deren Entfernen auf den Projekt-Hooks des Repos selbst (.codex/hooks.json).

Auf dem Rechner, auf dem die Prüfungen dieses Beitrags liefen, ist kein codex-Konto vorhanden. Der Live-Pfad endet dort an der Anmeldemaske statt am Hook-Dialog - genau dieser Unterschied zeigt, dass die Korrektur greift, aber die Erfolgszeile ist dort nicht reproduzierbar. Auf einem angemeldeten Rechner genügt ein Lauf:

FM_SEND_INBOX_LIVE_E2E=1 FM_SEND_INBOX_LIVE_HARNESSES=codex tests/fm-send-inbox-doorbell-live-e2e.test.sh

Testing

Exercised spawn hook-layer live guard, spawn dispatch profile, and the doorbell test's real codex launch recipe against installed codex-cli 0.163.0: --disable hooks turns hooks off and the live doorbell attempt no longer hits the hook-trust modal, but without Codex login this host could not finish the acted+acked doorbell success line the intent asks for.

Evidence: Testing notes and evidence index

Source: Testing notes and evidence index

# Doorbell codex launch parity — local test evidence

## Change under test
`tests/fm-send-inbox-doorbell-live-e2e.test.sh` `launch_cmd codex` now matches
`bin/fm-spawn.sh` crewmate path by adding `--disable hooks`.

## Observable behavior on this machine (codex-cli 0.163.0)

\### Hook feature effect of the recipe (no model tokens)
- FIXED recipe `codex --dangerously-bypass-approvals-and-sandbox --disable hooks features list`
  → `hooks ... false`
- WITHOUT flag `codex --dangerously-bypass-approvals-and-sandbox features list`
  → `hooks ... true` (machine `~/.codex/config.toml` has `[features] hooks = true` and `hooks.json` present)

\### fm-spawn parity (no model tokens)
`tests/fm-codex-hook-layer-live-e2e.test.sh` passed:
- installed codex still publishes the hooks feature
- captured firstmate crewmate launch flags leave hooks disabled

\### Live doorbell attempt (codex only, timeout 45s)
`FM_SEND_INBOX_LIVE_E2E=1 FM_SEND_INBOX_LIVE_HARNESSES=codex FM_SEND_INBOX_LIVE_TIMEOUT=45 bash tests/fm-send-inbox-doorbell-live-e2e.test.sh`

Result: failed on **Sign in with ChatGPT** login screen (`codex login status` → Not logged in).
Pane capture showed login choices, **not** "Hooks need review".
So the fixed recipe no longer parks on the hook-trust modal; the remaining blocker on this host is missing Codex auth, which prevents the full acted+acked doorbell proof the intent requires.

## Not available here
- Codex is not logged in (`codex login status` → Not logged in)
- No OPENAI_API_KEY / CODEX_API_KEY in the environment
- Therefore the triple live doorbell success line
  `ok - codex (codex-cli 0.163.0): the doorbell reached a real worker, which acted and acked with the mv`
  cannot be reproduced on this gate host.

## Behavioral proof of the test's own launch_cmd (no login)
Extracted `launch_cmd` from `tests/fm-send-inbox-doorbell-live-e2e.test.sh` and ran:
`codex --dangerously-bypass-approvals-and-sandbox --disable hooks features list`
→ hooks=false on codex-cli 0.163.0.
Counterfactual without the flag trips the test's own pin message.
Evidence: Recipe flags disable hooks on real codex

Source: Recipe flags disable hooks on real codex

recipe: codex --dangerously-bypass-approvals-and-sandbox --disable hooks hooks_line: hooks stable false ok - doorbell live-e2e launch_cmd codex leaves hooks disabled on codex-cli codex-cli 0.163.0

recipe: codex --dangerously-bypass-approvals-and-sandbox --disable hooks
flags: --dangerously-bypass-approvals-and-sandbox --disable hooks
hooks_line: hooks                                    stable             false
ok - doorbell live-e2e launch_cmd codex leaves hooks disabled on codex-cli codex-cli 0.163.0
fail would fire: codex launch recipe lost --disable hooks; the check would park on the hook-trust modal instead of judging the doorbell
Evidence: hooks feature with vs without --disable hooks

Source: hooks feature with vs without --disable hooks

FIXED recipe → hooks false; WITHOUT flag → hooks true

## Recipe under test (launch_cmd codex)
codex --dangerously-bypass-approvals-and-sandbox --disable hooks

## Effective features with FIXED recipe flags
hooks                                    stable             false

## Effective features WITHOUT --disable hooks (baseline machine config has hooks=true)
hooks                                    stable             true

## fm-spawn crewmate launch flags (captured via hook-layer live path)
Evidence: fm-codex-hook-layer-live-e2e passed

Source: fm-codex-hook-layer-live-e2e passed

ok - codex codex-cli 0.163.0 runs a firstmate crewmate launch with its hook layer disabled

ok - codex codex-cli 0.163.0 still publishes the hook feature flag firstmate disables
ok - codex codex-cli 0.163.0 runs a firstmate crewmate launch with its hook layer disabled
# all fm-codex-hook-layer-live-e2e tests passed
Evidence: Live codex doorbell attempt (auth blocked)

Source: Live codex doorbell attempt (auth blocked)

not ok - codex (codex-cli 0.163.0): doorbell not honored within 45s (acted=no acked=no) # pane shows Sign in with ChatGPT, not Hooks need review

# codex (codex-cli 0.163.0): idle composer never classified empty; proceeding as production does (advisory check skips only on pending)
# codex (codex-cli 0.163.0): re-rang the doorbell once (watcher's role) at 22s
not ok - codex (codex-cli 0.163.0): doorbell not honored within 45s (acted=no acked=no)
#     Sign in with ChatGPT to use Codex as part of your paid plan
#     or connect an API key for usage-based billing
#   > 1. Sign in with ChatGPT
#        Usage included with Plus, Pro, Business, and Enterprise plans
#     2. Sign in with Device Code
#        Sign in from another device with a one-time code
#     3. Provide your own API key
#        Pay for what you use
#     Press enter to continue
#   Login server error: Login was not completed
not ok - live steering-inbox doorbell guard found failures above
Evidence: tmux pane without --disable hooks

Source: tmux pane without --disable hooks

  Welcome to Codex, OpenAI's command-line coding agent

  Sign in with ChatGPT to use Codex as part of your paid plan
  or connect an API key for usage-based billing

> 1. Sign in with ChatGPT
     Usage included with Plus, Pro, Business, and Enterprise plans

  2. Sign in with Device Code
     Sign in from another device with a one-time code

  3. Provide your own API key
     Pay for what you use

  Press enter to continue
Evidence: tmux pane with --disable hooks

Source: tmux pane with --disable hooks

  Welcome to Codex, OpenAI's command-line coding agent

  Sign in with ChatGPT to use Codex as part of your paid plan
  or connect an API key for usage-based billing

> 1. Sign in with ChatGPT
     Usage included with Plus, Pro, Business, and Enterprise plans

  2. Sign in with Device Code
     Sign in from another device with a one-time code

  3. Provide your own API key
     Pay for what you use

  Press enter to continue
Evidence: fm-spawn-dispatch-profile suite

Source: fm-spawn-dispatch-profile suite

ok - allowlist=absent preserves the operational floor and filters only when opted in
ok - allowlist=missing-config preserves the operational floor and filters only when opted in
ok - allowlist=enabled preserves the operational floor and filters only when opted in
ok - allowlist=empty preserves the operational floor and filters only when opted in
ok - invalid allowlist names refuse before launch or task publication
ok - inaccessible config with present allowlist refuses before launch or task publication
ok - inaccessible config with absent allowlist refuses before launch or task publication
ok - inaccessible ancestor with present allowlist refuses before launch or task publication
ok - inaccessible ancestor with absent allowlist refuses before launch or task publication
ok - secondmate launch inherits the allowlist for subsequent worker launches
ok - local inheritance preserves the allowlist on source errors and mirrors proven absence
ok - remote inheritance preserves the allowlist on source errors and mirrors proven absence
WORKER-RAN
WORKER-RAN
WORKER-RAN
WORKER-RAN
skip: fish not found (fish pane launch); only a static syntax check ran
ok - launch appends the hooks config while preserving inherited Git credentials in sh, bash and zsh
ok - fm-spawn: actual ship/scout launch commands deliver the worker role contract
ok - no --model/--effort records defaults and types the claude launch instructions
ok - a claude launch publishes the brief as an operational-inbox record and passes only the doorbell
ok - a secondmate claude launch publishes its brief record into the secondmate's own home
ok - a claude spawn whose launch-brief record cannot publish stops with a clear error and sends no launch
ok - non-cursor launches clear inherited Cursor identity markers
ok - relative home overrides ignore CDPATH and become absolute before spawn launch construction
ok - FM_HOME defaults resolve relative paths and preserve absolute spellings
ok - absolute override spellings are preserved in spawn launch paths
ok - unresolvable relative spawn overrides fail with named diagnostics
ok - active crew-dispatch profile requires an explicit harness for ship spawns
ok - active crew-dispatch profile requires an explicit harness for scout spawns
ok - active crew-dispatch profile allows an explicit resolved harness
ok - active crew-dispatch profile allows the legacy positional harness form
ok - active crew-dispatch profile allows the raw launch-command escape hatch
ok - a chained raw launch commits through the AI-trailer strip in every step
ok - claude receives --model and --effort profile flags
ok - codex receives --model and model_reasoning_effort profile flags
ok - codex Luna receives --model and model_reasoning_effort max profile flags
ok - codex omits max for models without the catalog capability
ok - a codex crewmate launches with no hook layer and keeps its turn-end signal
ok - a codex secondmate keeps the project hook layer its primary session runs on
ok - grok receives --model and --reasoning-effort profile flags
ok - grok omits unsupported max reasoning effort
ok - grok omits unsupported xhigh reasoning effort
ok - cursor receives its model-qualified reasoning class and exact task workspace
ok - cursor refuses model ids absent from its resolved binary's live catalog
ok - cursor preserves the requested model when its live catalog is unreachable
ok - opencode receives --model and the effort as its config's agent variant
ok - opencode without an effort keeps its launch config unchanged
ok - opencode emits the variant for an effort the openai family exposes
ok - opencode omits the variant for an effort outside the model family's list
ok - native effort validator checks harness and model as separate axes
ok - Ultra is explicit for native Pi and Pi-signed, including direct-PR, and refuses unsupported profiles before provisioning
ok - batch dispatch preserves native Ultra in metadata and launch flags
ok - Pi scout spawn enters the recorded worktree before launch
ok - pi receives --model and --thinking max profile flags
ok - Pi launch probing omits --tui-mode on older Pi and preserves it on supporting Pi
ok - pi-signed shares Pi launch semantics while preserving its configured and recorded identity
ok - pi-signed refuses safely and actionably when the selected executable is unavailable
ok - pi-signed is a distinct persistent secondmate runtime with shared Pi supervision semantics
ok - seeded Pi/pi-signed secondmate launches carry session --approve when advertised
ok - ordinary Pi worker launches omit --approve
ok - Pi approve probing omits --approve when help does not advertise it
ok - Pi and pi-signed ship and scout launches carry the configured tool exclusions
ok - Pi worker registries report unmatched and unverified exclusions without reporting exact matches
ok - an absent or empty exclusion list leaves every runtime unaffected
ok - a runtime that cannot hide tools, or a raw launch, refuses a non-empty exclusion list
ok - a malformed exclusion entry refuses the spawn before any launch or record
ok - Pi and pi-signed ship and scout launches refuse when the exclusion file disappears after its checks
ok - exclusions stay in the home that configured them and skip secondmate agents
ok - batch dispatch forwards shared --harness, --model, and --effort to every pair
ok - claude forwards firstmate's CLAUDE_CONFIG_DIR so the crewmate uses the same credential store
ok - the primary-owned Lavish server address reaches every worker launch
cat: /tmp/fm-spawn-dispatch-profile.iV4SeX/profile-lavish-ambient/pane.log: No such file or directory
ok - absent Lavish configuration preserves the destination environment
ok - claude omits the config-dir prefix when firstmate runs with the single-store default
ok - config/claude-permission-mode=bypass launches exactly as an absent file does
ok - config/claude-permission-mode=auto replaces --dangerously-skip-permissions with --permission-mode auto
ok - config/claude-permission-mode=auto reaches scout launches too
ok - claude worker launches cover the task-channel directories in bypass and auto modes
ok - an unrecognized config/claude-permission-mode token refuses before any endpoint or metadata
ok - config/claude-permission-mode changes claude launches only
ok - non-claude harnesses do not receive the claude CLAUDE_CONFIG_DIR prefix
ok - a claude task launch establishes only Firstmate's task control channels through the system prompt
ok - a persistent claude secondmate keeps its supervisor contract without a task-worker authority overlay
ok - fm-spawn: a Claude launch longer than 1024 bytes is delivered intact through the staging path
ok - a claude crewmate launch carries the attribution-off policy in its own settings
ok - keep-ai-trailers omits Claude attribution settings and the pane strip hooks
ok - keep-ai-trailers is inherited so a secondmate's crew launch keeps AI trailers
ok - a claude secondmate launch carries the attribution-off policy too
ok - active crew-dispatch profile does not block secondmate launches
# all fm-spawn-dispatch-profile tests passed
- Outcome: ⚠️ 1 warning across 1 run (9m54s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ tests/fm-send-inbox-doorbell-live-e2e.test.sh - The full end-user doorbell proof required by intent (ok - codex ... acted and acked with the mv on a logged-in codex-cli 0.163.0) could not be completed on this gate host: codex login status is Not logged in, no OPENAI/CODEX API key is present, and the live codex-only run parked on the ChatGPT sign-in screen. Partial proof did succeed: the test's launch_cmd now carries --disable hooks, those flags leave hooks=false on installed codex 0.163.0, fm-spawn crewmate parity still disables hooks, and the live attempt no longer parks on "Hooks need review". Decide whether author-side live transcripts already satisfy PR 7362 or whether a logged-in host must re-run FM_SEND_INBOX_LIVE_E2E=1 FM_SEND_INBOX_LIVE_HARNESSES=codex.
  • bash tests/fm-codex-hook-layer-live-e2e.test.sh
  • bash tests/fm-spawn-dispatch-profile.test.sh
  • codex --dangerously-bypass-approvals-and-sandbox --disable hooks features list (hooks=false) vs without flag (hooks=true)
  • Extracted real launch_cmd from tests/fm-send-inbox-doorbell-live-e2e.test.sh and verified flags leave hooks disabled on codex-cli 0.163.0
  • Counterfactual: recipe without --disable hooks trips the test's pin message
  • FM_SEND_INBOX_LIVE_E2E=1 FM_SEND_INBOX_LIVE_HARNESSES=codex FM_SEND_INBOX_LIVE_TIMEOUT=45 bash tests/fm-send-inbox-doorbell-live-e2e.test.sh (failed on sign-in, not hook-trust modal)
  • tmux pane captures of codex with/without --disable hooks on this host
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Der Kopf des Tests sagt, jedes Programm werde so gestartet, wie
bin/fm-spawn.sh es startet. Im codex-Zweig von launch_cmd fehlte dabei
--disable hooks, das fm-spawn im crewmate- und scout-Pfad setzt.

Ohne den Schalter parkt codex auf dem Hook-Vertrauensdialog ("N hooks
are new or changed"), dessen Auswahl auf "Review hooks" aufsetzt und der
mit der Tastenebene dieses Werkzeugs nicht beantwortbar ist. Der Lauf
meldet dann die Tuerklingel als nicht befolgt, obwohl er ueber die
Tuerklingel gar nichts ausgesagt hat - und das auf jedem Checkout, weil
schon die projekteigene .codex/hooks.json den Dialog aufzieht.

Dazu eine knappe Zusicherung am Startrezept, damit der Schalter beim
naechsten Umbau nicht wieder still ausfaellt.
@thelad-dev

Copy link
Copy Markdown
Contributor Author

Kurz zu den Prüfungen: "Behavior portable serial 2" ist ohne Urteil abgebrochen, das ist kein fehlgeschlagener Test - der Shard ist in die 30-Minuten-Grenze gelaufen, und die geänderte Datei liegt gar nicht in diesem Shard, sondern in Shard 9, der grün ist. Die anderen 19 Prüfungen sind grün.

Könntest du diesen einen Abschnitt nochmal laufen lassen? Mir fehlt dafür das Recht in diesem Repo.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @thelad-dev — clear finding, and the three-run comparison (machine hooks → repo hooks → --disable hooks) makes the cause unambiguous.

I read tip 60a39eda against main 5f2b81bc: one test file, tests/fm-send-inbox-doorbell-live-e2e.test.sh. The codex launch recipe now matches bin/fm-spawn.sh's crewmate recipe (which already passes --disable hooks), and the new pin runs after fm_live_gate, so it only fires on an opted-in live run. No production code, workflow, network, or credential surface.

Contract-class (mine): restore. The test's own header promises each harness is launched "the way bin/fm-spawn.sh launches it"; for codex it wasn't. No product default changes.

VISION.md per rule:

  1. One captain, one interface: aligns (removes a false "doorbell unhonored" verdict).
  2. Authority is explicit: aligns (no new authority).
  3. Scripts own the mechanics: aligns (deterministic recipe pin).
  4. A restart is a non-event: neutral.
  5. Delegation with a spine: aligns (the codex lane of the guard can now actually prove something).
  6. The fleet outlives any vendor: aligns (keeps the codex adapter's live verification honest).
  7. Scope: aligns (test-only; "field incidents become regression coverage").

Your logged-in run of the doorbell check with only this flag added (ok - codex (codex-cli 0.163.0): the doorbell reached a real worker, which acted and acked with the mv) is good enough live evidence for a one-flag test-recipe change. You're right about the checks: only "Behavior portable serial 2" was cancelled at the 30-minute limit, so I've re-run the failed job. Nothing needed from you — this is waiting on that re-run; green means it's on the merge path.

@thelad-dev

Copy link
Copy Markdown
Contributor Author

Thanks for the re-run - it hit the same wall: the job started 14:30:36Z and was cancelled 15:00:57Z, so exactly 30 minutes again. Same shape on #7408 (started 15:15:33Z, cancelled 15:46:04Z), and Behavior portable serial 2 has done this four times today across different branches.

So I don't think another re-run clears it. From the logs the shard isn't failing an assertion, it's just running past the limit - on my branch it was mid tests/fm-task-delivery.test.sh, and the shard doesn't carry the suites either PR touches. Looks like that shard's share of the suite has outgrown its timeout rather than anything in these changes.

Happy to leave both sitting until you've decided what to do with it - nothing else needed from my side.

@kunchenguid
kunchenguid merged commit 4de02c0 into kunchenguid:main Oct 16, 2026
54 of 56 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @thelad-dev — really appreciate you taking the time on this.