fix(codexcli): stop force-writing stale hooks feature flag; preserve granular approval keys#2099
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up for Codex CLI upstream updates (#2064). Three parts:
1. Hooks — stop force-writing the stale
[features] hooks = trueflagHooks 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 legacycodex_hookskey. A user's existinghooks = true/falsesetting 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 granularapproval_policyobject that rulesync's permissions adapter does not model. Investigation confirmedcodexcli-permissions.ts's read-modify-write already preserves unknown top-level keys (it only overwritespermissions/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 incodexcli-command.ts. Generation behavior is unchanged (documentation only).Verification
pnpm cicheckfully green: 298 test files, 6625 tests; cspell, secretlint all pass.References
Closes #2064