codex: support hooks in config.toml and requirements.toml#18893
Draft
eternal-openai wants to merge 7 commits intomainfrom
Draft
codex: support hooks in config.toml and requirements.toml#18893eternal-openai wants to merge 7 commits intomainfrom
eternal-openai wants to merge 7 commits intomainfrom
Conversation
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
Support the existing hooks schema in inline TOML so hooks can be configured from both
config.tomland enterprise-managedrequirements.tomlwithout requiring a separatehooks.jsonpayload.This gives enterprise admins a way to ship managed hook policy through the existing requirements channel while still leaving script delivery to MDM or other device-management tooling, and it keeps
hooks.jsonworking unchanged for existing users.This also lays the groundwork for follow-on managed filtering work such as #15937, while continuing to respect project trust gating from #14718. It does not implement
allow_managed_hooks_onlyitself.What changed
codex-rs/hooksintocodex-rs/configso the same schema can powerhooks.json, inlineconfig.tomlhooks, and managedrequirements.tomlhookshookssupport to bothConfigTomlandConfigRequirementsToml, including requirements-sidemanaged_dir/windows_managed_dirConstrained, so managed hook policy is merged atomically and cannot drift across requirement sourceshooks.json, then per-layer inline TOML hooks, with a warning when a single layer defines both representations/debug-configcodex-rs/config,codex-rs/hooks,codex-rs/core/src/config_loader/tests.rs, andcodex-rs/core/tests/suite/hooks.rsTesting
cargo test -p codex-configcargo test -p codex-hookscargo test -p codex-app-server config_apiDocumentation
Companion updates are needed in the developers website repo for: