[Bug]: Codex hooks registered without a timeout field; codex-hook.sh curl has no --max-time
Environment
- Orca v1.4.27 (com.stablyai.orca), macOS
- Codex CLI hooks (
~/.codex/hooks.json)
What happens
Orca registers its agent hooks into ~/.codex/hooks.json, but the entries it
writes do not include a timeout field. On my machine all 6 Orca-registered
Codex hooks (events: PreToolUse, PostToolUse, PermissionRequest,
SessionStart, Stop, UserPromptSubmit) look like:
{ "command": "if [ -x '~/.orca/agent-hooks/codex-hook.sh' ]; then /bin/sh '...'; fi" }
— no timeout key.
Two related concerns:
- Tools that read/validate
~/.codex/hooks.jsonflag every Orca hook as "unmanaged hook without timeout". ~/.orca/agent-hooks/codex-hook.shPOSTs tohttp://127.0.0.1:$ORCA_AGENT_HOOK_PORT/hook/codexviacurl -sSwithout--max-time. If the local Orca endpoint is down/unresponsive, the curl (and thus the agent's hook step) can block.
Expected
- Each hook entry Orca writes includes a sane default
timeout(e.g.10). - The hook script's
curluses--max-timeso a stalled endpoint can't hang the agent.
Repro
- Install Orca, let it register Codex hooks.
- Inspect
~/.codex/hooks.json→ Orca entries have notimeoutfield.
Suggested fix
- When writing hook entries (codex/claude/cursor/…), add
"timeout": 10(or similar) per entry. - In
codex-hook.sh(and the sibling*-hook.shscripts), add--max-time 5(or similar) to thecurlcall.
Fixed the Codex side in #4638 — \ imeout: 10\ is now written to each hook command entry in ~/.codex/hooks.json\ during both local install and remote install.
Note that other agents (Claude, Cursor, Gemini, Droid, Grok, Antigravity, Command Code) use the same pattern of writing hooks without a \ imeout\ field. I kept this PR scoped to Codex per the issue, but if y'all want me to follow up with a pass across the other agents, happy to do it in a separate PR — it's the same one-line fix in each hook service.
After the Codex-side fix, I would add one cross-agent hook install test so this does not regress in the sibling adapters.
Fixture shape:
- generate hook config for each supported host
- assert every managed hook entry has a timeout
- assert the shell wrapper has a transport timeout such as
curl --max-time - simulate a dead local endpoint and assert the hook returns within budget
Codex exposed the failure first because hooks sit on a very visible critical path, but the same local-endpoint pattern can block other agent hosts if their wrappers wait forever.
Generated with ax.