Make plugin guidance react to environment readiness (#30223)

## Why

Generic plugin guidance is currently emitted only with initial context
from host plugin state. An executor-selected plugin can become available
later in the same turn, making its skills and tools usable without ever
telling the model how plugin capabilities should be used.

## What

- project every ready selected plugin package, including skill-only
plugins
- carry plugin availability with the exact MCP runtime projection while
preserving MCP manager reuse when servers and connectors are unchanged
- move generic plugin guidance from the static initial-context path into
persisted World State
- recognize legacy and retained plugin fragments so resume and
compaction do not duplicate guidance

## Testing

- `just test -p codex-mcp-extension`
- `just test -p codex-core plugins_instructions`
- `just test -p codex-core
plugin_availability_change_reuses_the_mcp_manager`
- `just test -p codex-app-server --test all selected_capabilit`
This commit is contained in:
sayan-oai authored and GitHub committed 2026-07-06 07:05:40 -07:00
1 parent be33f80bc6
commit 9c5be7e1d5
21 files changed
+443 -94

No files matched your search

+10 -2
View File
@@ -107,18 +107,25 @@ impl SessionServices {
pub(crate) async fn install_mcp_connection_manager(
&self,
config: Arc<McpConfig>,
plugins_available: bool,
runtime_context: McpRuntimeContext,
available_environment_ids: Vec<String>,
manager: McpConnectionManager,
) -> Result<()> {
let runtime =
self.publish_mcp_runtime(config, runtime_context, available_environment_ids, manager);
let runtime = self.publish_mcp_runtime(
config,
plugins_available,
runtime_context,
available_environment_ids,
manager,
);
runtime.manager().validate_required_servers().await
}
pub(crate) fn publish_mcp_runtime(
&self,
config: Arc<McpConfig>,
plugins_available: bool,
runtime_context: McpRuntimeContext,
available_environment_ids: Vec<String>,
manager: McpConnectionManager,
@@ -129,6 +136,7 @@ impl SessionServices {
self.mcp_connection_manager.store(Arc::clone(&manager));
let runtime = Arc::new(McpRuntimeSnapshot::new(
config,
plugins_available,
manager,
runtime_context,
available_environment_ids,