Skip to content

fix(live): spawn answers Codex's hooks-review prompt without trusting - #181

Merged
ClementWalter merged 1 commit into
mainfrom
fix/live-spawn-codex-hook-trust
Dec 4, 2026
Merged

ClementWalter merged 1 commit into
mainfrom
fix/live-spawn-codex-hook-trust

Conversation

@ClementWalter

Copy link
Copy Markdown
Owner

live spawn codex timed out whenever Codex had hooks that were new or changed since they were last trusted (today: Orca rewrote ~/.codex/hooks.json). Codex stops on "Hooks need review" before it registers, so spawn gave up after 120 s.

Codex 0.169.0 offers one flag for this, --dangerously-bypass-hook-trust, which runs the untrusted hooks. Its help reserves it for "automation that already vets hook sources", and spawn vets nothing, so it is not used. --disable codex_hooks also clears the prompt, but it switches off the user's trusted hooks too.

Instead, spawn.wait_for now calls an on_poll callback. For Codex, prompt_answerer watches the tmux screen and presses 3 ("Continue without trusting") once. The changed hooks stay off for that agent, the trusted ones keep running, and nothing is written to the trust store. When no known prompt shows, it sends no keys.

Proof: a scratch folder with an untrusted project hook in .codex/hooks.json.

  • Before the fix, plain codex stopped on the prompt.
  • With the fix, live spawn codex --timeout 60, run from a main Claude session, printed started codex:01a24160-… and the agent answered "hi".
  • The hook did not run and config.toml gained no trust entry.
  • live stop hooktrust-proof --yes ended it.

Nothing to do before merge or deploy.

A Codex whose hooks changed since they were last trusted stops on "Hooks need
review" before it registers, so `live spawn codex` timed out. Spawn now picks
"Continue without trusting" on the tmux screen: those hooks stay off for the
agent and nothing is trusted. --dangerously-bypass-hook-trust is not used: it
would run hooks nobody vetted.
@ClementWalter
ClementWalter merged commit 565b5b0 into main Dec 4, 2026
5 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