Remove plugin hooks feature flag (#22552)

# Why

This is a follow-up stacked on top of the `plugin_hooks` default-on
change. Once we are comfortable making plugin hooks part of the normal
plugin behavior, the separate feature flag stops buying us much and
leaves extra branching/cache state behind.

# What

- remove the `PluginHooks` feature and generated config-schema entries
- make plugin hook loading/listing follow plugin enablement directly
- drop plugin-manager cache/state that only existed to distinguish
hook-flag toggles
- remove tests and fixtures that modeled `plugin_hooks = true/false`
This commit is contained in:
Abhinav
2026-05-21 12:15:18 -07:00
committed by GitHub
Unverified
parent ac0bff27e7
commit 24faf49b2a
12 changed files with 58 additions and 166 deletions
+6 -3
View File
@@ -140,7 +140,7 @@ pub enum Feature {
ToolSuggest,
/// Enable plugins.
Plugins,
/// Enable plugin-bundled lifecycle hooks.
/// Removed compatibility flag for plugin-bundled lifecycle hooks.
PluginHooks,
/// Allow the in-app browser pane in desktop apps.
///
@@ -434,6 +434,9 @@ impl Features {
"image_detail_original" => {
continue;
}
"plugin_hooks" => {
continue;
}
"skill_env_var_dependency_prompt" => {
continue;
}
@@ -979,8 +982,8 @@ pub const FEATURES: &[FeatureSpec] = &[
FeatureSpec {
id: Feature::PluginHooks,
key: "plugin_hooks",
stage: Stage::Stable,
default_enabled: true,
stage: Stage::Removed,
default_enabled: false,
},
FeatureSpec {
id: Feature::InAppBrowser,
+23 -6
View File
@@ -76,6 +76,13 @@ fn apply_patch_freeform_is_removed_and_disabled_by_default() {
);
}
#[test]
fn plugin_hooks_is_removed_and_disabled_by_default() {
assert_eq!(Feature::PluginHooks.stage(), Stage::Removed);
assert_eq!(Feature::PluginHooks.default_enabled(), false);
assert_eq!(feature_for_key("plugin_hooks"), Some(Feature::PluginHooks));
}
#[test]
fn code_mode_only_requires_code_mode() {
let mut features = Features::with_defaults();
@@ -194,12 +201,6 @@ fn tool_search_is_removed_and_disabled_by_default() {
assert_eq!(feature_for_key("tool_search"), Some(Feature::ToolSearch));
}
#[test]
fn plugin_hooks_are_stable_and_enabled_by_default() {
assert_eq!(Feature::PluginHooks.stage(), Stage::Stable);
assert_eq!(Feature::PluginHooks.default_enabled(), true);
}
#[test]
fn browser_controls_are_stable_and_enabled_by_default() {
assert_eq!(Feature::InAppBrowser.stage(), Stage::Stable);
@@ -499,6 +500,22 @@ fn from_sources_ignores_removed_apply_patch_freeform_feature_key() {
assert_eq!(features, Features::with_defaults());
}
#[test]
fn from_sources_ignores_removed_plugin_hooks_feature_key() {
let features_toml = FeaturesToml::from(BTreeMap::from([("plugin_hooks".to_string(), true)]));
let features = Features::from_sources(
FeatureConfigSource {
features: Some(&features_toml),
..Default::default()
},
FeatureConfigSource::default(),
FeatureOverrides::default(),
);
assert_eq!(features, Features::with_defaults());
}
#[test]
fn multi_agent_v2_feature_config_deserializes_boolean_toggle() {
let features: FeaturesToml = toml::from_str(