Skip to content

fix(codexcli): stop force-writing stale hooks feature flag; preserve granular approval keys#2099

Merged
dyoshikawa merged 1 commit into
mainfrom
resolve-issue-2064-codexcli-followups
Jul 1, 2026
Merged

fix(codexcli): stop force-writing stale hooks feature flag; preserve granular approval keys#2099
dyoshikawa merged 1 commit into
mainfrom
resolve-issue-2064-codexcli-followups

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Follow-up for Codex CLI upstream updates (#2064). Three parts:

1. Hooks — stop force-writing the stale [features] hooks = true flag

Hooks are GA and enabled by default; the flag is no longer required. buildCodexConfigTomlContent (src/features/hooks/codexcli-hooks.ts) no longer force-writes it, while still cleaning up the deprecated legacy codex_hooks key. A user's existing hooks = true/false setting is left untouched (not stripped, not enforced).

2. Permissions — preserve granular approval keys on round-trip

Codex CLI added default_tools_approval_mode, approvals_reviewer, and a granular approval_policy object that rulesync's permissions adapter does not model. Investigation confirmed codexcli-permissions.ts's read-modify-write already preserves unknown top-level keys (it only overwrites permissions/default_permissions), so these survive a round-trip unchanged. Added an explanatory comment (mirroring the amp/devin sibling-key-preservation pattern) and a regression test locking this behavior in. No new canonical mapping was invented (that's explicitly "evaluate" scope in the issue and too speculative).

3. Commands — document the custom-prompts deprecation

Upstream states custom prompts are deprecated in favor of skills (no removal date). Documented this in docs/reference/file-formats.md (+ synced skill copy) and added a code comment in codexcli-command.ts. Generation behavior is unchanged (documentation only).

Verification

pnpm cicheck fully green: 298 test files, 6625 tests; cspell, secretlint all pass.

References

Closes #2064

…granular approval keys

Codex CLI hooks are now GA and enabled by default, so `[features] hooks = true` is no longer required. buildCodexConfigTomlContent stops force-writing it while still cleaning up the deprecated `codex_hooks` legacy alias.

Codex CLI also grew a granular tool-approval surface (default_tools_approval_mode, approval_policy, approvals_reviewer, and their apps.<id>.*/mcp_servers.<id>.* variants) that rulesync's codexcli permissions adapter does not model. Add a regression test plus a clarifying comment confirming these keys already survive a read-modify-write round-trip untouched, since only the permissions/default_permissions keys are overwritten.

Document that Codex CLI custom prompts are deprecated upstream in favor of skills, without changing CodexcliCommand's generation behavior (no removal date announced).

Fixes #2064

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit 95baa7a into main Jul 1, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-2064-codexcli-followups branch July 1, 2026 02:15
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.

Follow up Codex CLI upstream updates: granular tool-approval keys (default_tools_approval_mode, approval_policy object)

2 participants