Alias codex_hooks feature as hooks (#20522)

# Why

The hooks feature flag should use the concise canonical name `hooks`,
while existing configs that still use `codex_hooks` continue to work
during the rename.

# What

- change the canonical `Feature::CodexHooks` key from `codex_hooks` to
`hooks`
- register `codex_hooks` through the existing legacy-alias path
- update the config schema and canonical config fixtures to prefer
`hooks`
- add regression coverage that both `hooks` and `codex_hooks` resolve to
`Feature::CodexHooks`

# Verification

- `cargo test -p codex-features`
- `cargo test -p codex-core config::schema_tests`
- `cargo test -p codex-core
pre_tool_use_blocks_shell_when_defined_in_config_toml`
- `cargo test -p codex-app-server
hooks_list_uses_each_cwds_effective_feature_enablement`
This commit is contained in:
Abhinav
2026-04-30 17:46:33 -07:00
committed by GitHub
parent 5affb7f9d5
commit 0d9a5d20ec
6 changed files with 21 additions and 5 deletions

View File

@@ -49,6 +49,10 @@ const ALIASES: &[Alias] = &[
legacy_key: "telepathy",
feature: Feature::Chronicle,
},
Alias {
legacy_key: "codex_hooks",
feature: Feature::CodexHooks,
},
];
pub fn legacy_feature_keys() -> impl Iterator<Item = &'static str> {

View File

@@ -782,7 +782,7 @@ pub const FEATURES: &[FeatureSpec] = &[
},
FeatureSpec {
id: Feature::CodexHooks,
key: "codex_hooks",
key: "hooks",
stage: Stage::Stable,
default_enabled: true,
},

View File

@@ -267,6 +267,12 @@ fn collab_is_legacy_alias_for_multi_agent() {
assert_eq!(feature_for_key("collab"), Some(Feature::Collab));
}
#[test]
fn codex_hooks_is_legacy_alias_for_hooks() {
assert_eq!(feature_for_key("hooks"), Some(Feature::CodexHooks));
assert_eq!(feature_for_key("codex_hooks"), Some(Feature::CodexHooks));
}
#[test]
fn multi_agent_is_stable_and_enabled_by_default() {
assert_eq!(Feature::Collab.stage(), Stage::Stable);