Refresh managed MCP requirements in place (#63348)

Update the retained configuration stack during session refresh. Copy only
the MCP server, plugin, and feature requirements in both the parsed and
TOML representations, avoiding a clone of the entire stack.

GitOrigin-RevId: 1bae8cc86a59b4638f9f6cd48ee9eb17de31fef2
This commit is contained in:
ioanbudea-OAI
2026-11-23 14:26:56 +00:00
committed by copyberry
parent a52fdb3ba6
commit 02390c8d8e
2 changed files with 22 additions and 14 deletions
+2 -2
View File
@@ -166,9 +166,9 @@ impl Session {
Constrained::allow_any(Default::default())
};
}
config.config_layer_stack = config
config
.config_layer_stack
.with_mcp_requirements_from(&next_config.config_layer_stack);
.refresh_mcp_requirements(&next_config.config_layer_stack);
if let Err(err) = config.features.refresh_mcp_features(&next_config.features) {
warn!(%err, "failed to apply managed MCP feature restrictions");
config.mcp_servers = Constrained::allow_any(Default::default());