Revert Codex hook approval merge for dogfood

Merged
LA
6mo ago
+162-1239

Reverts https://github.com/manaflow-ai/cmux/pull/4035 so the Codex hook approval change can be dogfooded before relanding.


[!NOTE]
Medium Risk
Modifies Codex hook install/uninstall behavior and TOML config rewriting, which can affect users’ hook configs and migration paths. Risk is limited to hook management, but regressions could break existing Codex hook setups or leave stale entries behind.

Overview
Reverts the Codex hook approval/trust changes: the CLI no longer computes/writes Codex hook trust hashes into config.toml, and install messaging is simplified to only enabling codex_hooks.

Hook install/uninstall now identifies cmux-owned entries via substring markers (including legacy cmux codex-hook / cmux feed-hook) rather than exact command matching, and no longer tries to preserve prior insertion positions when re-installing.

Codex config.toml editing is rewritten to directly set/remove codex_hooks (including dotted form) and to strip legacy managed blocks; Python regression tests are trimmed/updated accordingly, and a workspace unit test is updated for a renamed auto-resume field.

Reviewed by Cursor Bugbot for commit dee2d2fcdbfe8b46294d4b49726f87e600018cf4. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Reverts Codex hook auto-approval so we can dogfood the flow before relanding. Removes writing trusted hashes to Codex config.toml and restores the previous codex_hooks feature behavior.

  • Refactors
    • Remove hook trust/approval generation and migration; stop writing hooks.state.*.trusted_hash to config.toml.
    • Restore marker-based detection for cmux-owned hooks; simplify install/uninstall without insertion indices.
    • cmux hooks codex install now enables [features] with codex_hooks = true (no migration to features.hooks).
    • cmux hooks codex uninstall removes the empty [features] table when applicable.
    • Update tests to drop trust/approval cases and assert codex_hooks behavior only.
    • Minor test rename: restorableAgentResumeState → restorableAgentAutoResumePending.

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling for Codex configuration files—now gracefully handles unreadable files instead of throwing errors.
  • Refactor

    • Simplified Codex hooks installation and detection mechanisms for improved reliability.

Review Change Stack