Preserve parent tool declarations in prediction forks (#57287)

## What changed

Keep inherited incremental tool declarations in MCP-disabled prediction forks and `thread/sample` requests, and append a developer notice that MCP tools are unavailable. Skip tool declaration updates within the inherited context window; new windows still declare the current tools.

Add the default-enabled `prediction_preserve_parent_tools` feature flag and its configuration schema entries.

## Testing

Update core snapshots and app-server tests to cover inherited declarations, the MCP-unavailable notice, preservation across MCP refresh, and continued parent tool availability.

GitOrigin-RevId: 3adf96c7d0e0093986dbdbd540bd47674a2c105c
This commit is contained in:
Keyan Zhang
2026-10-26 22:05:23 +00:00
committed by copyberry
parent 136d891a94
commit b46a3801e4
9 changed files with 174 additions and 150 deletions
+8
View File
@@ -287,6 +287,8 @@ pub enum Feature {
DeferredToolWorldState,
/// Track top-level tool definitions in world state and emit incremental context updates.
IncrementalTools,
/// Preserve inherited tool declarations in MCP-disabled prediction forks.
PredictionPreserveParentTools,
/// Expose MCP model-visible namespaces without the legacy `mcp__` prefix.
NonPrefixedMcpToolNames,
/// Enable discoverable tool suggestions for apps.
@@ -1695,6 +1697,12 @@ pub const FEATURES: &[FeatureSpec] = &[
stage: Stage::Stable,
default_enabled: true,
},
FeatureSpec {
id: Feature::PredictionPreserveParentTools,
key: "prediction_preserve_parent_tools",
stage: Stage::Stable,
default_enabled: true,
},
FeatureSpec {
id: Feature::NonPrefixedMcpToolNames,
key: "non_prefixed_mcp_tool_names",