[codex] Enable current Codex hook feature flag
CY
1mo ago+104+104+012345678901234567890123456789-44-44-01234567890123456789
Summary
- Update Codex hook setup to enable the current Codex runtime flag,
[features] codex_hooks = true, instead of the legacyhooks = truesetting. - Preserve user-owned
codex_hookssettings during install/uninstall while still removing cmux-owned marker blocks and legacy orphaned marker blocks. - Update regression coverage and docs so Codex hook setup reflects the current Codex CLI behavior.
Root cause: current Codex requires codex_hooks = true; cmux installed hooks = true, so Codex could skip UserPromptSubmit hooks and the sidebar would not show Running during interactive Codex requests.
Testing
python3 -m py_compile tests/test_codex_feed_hooks.pyswiftc -parse CLI/CMUXCLI+CodexConfigToml.swift CLI/CMUXCLI+AgentHookDefinitions.swiftgit diff --check HEAD~2..HEADPATH="/opt/homebrew/opt/zig@0.15/bin:$PATH" DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer ./scripts/reload.sh --tag fix-codex-running --launch- Verified with a temporary
CODEX_HOMEthatcmux hooks codex install --yeswrites[features] codex_hooks = trueand installs theUserPromptSubmithook. - Verified against
/tmp/cmux-debug-fix-codex-running.sockthat the generated shell hook updates sidebar state tocodex=Running icon=bolt.fill color=#4C8DFF. - Manually verified the isolated
cmux DEV fix-codex-running.appsidebar showsRunning.
Demo Video
For UI or behavior changes, include a short demo video (GitHub upload, Loom, or other direct link).
- Video URL or attachment: N/A; manually verified in an isolated tagged app and included the exact socket/sidebar-state verification above.
Review Trigger (Copy/Paste as PR comment)
@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review
Checklist
- I tested the change locally
- I added or updated tests for behavior changes
- I updated docs/changelog if needed
- I requested bot reviews after my latest commit (copy/paste block above or equivalent)
- All code review bot comments are resolved
- All human review comments are resolved
Summary by cubic
Switch Codex hook setup to the current codex_hooks = true flag and clean up legacy hooks = true so UserPromptSubmit hooks run and the sidebar shows Running during interactive requests. Preserve user settings on install/uninstall and clean up cmux-owned and legacy markers.
- Bug Fixes
- Install writes
[features] codex_hooks = true(orfeatures.codex_hooks = true), removes unmarked legacyhooks = true/features.hooks = true, and preserves existing disabledhookssettings. - Uninstall removes only cmux-owned blocks and orphaned markers, preserves/restores user
codex_hooksand legacyhooksvalues, and drops now-empty[features]tables. - Added regression tests for migration, legacy flag cleanup (incl. dotted keys and bracketed arrays), and uninstall; docs note Codex writes
~/.codex/hooks.jsonand enables[features] codex_hooks = true.
- Install writes
Summary by CodeRabbit
Release Notes
-
Documentation
- Added setup guide for Codex hook runtime configuration explaining the configuration process.
-
Improvements
- Updated Codex hooks feature configuration handling to improve setting recognition and management. Legacy hook settings are automatically cleaned up during configuration updates.