mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
c8c78b63a7
## Why #27870 teaches the MCP extension how to discover stdio MCP servers declared by a selected executor plugin, but app-server does not yet install that contributor or initialize its per-thread state. As a result, `thread/start.selectedCapabilityRoots` can select the plugin while its MCP servers remain inactive. This PR closes that app-server wiring gap: ```text thread/start(selectedCapabilityRoots) -> initialize the thread's selected-plugin MCP snapshot -> read the selected plugin's .mcp.json through its environment -> start declared stdio servers in that environment -> expose their tools only on the selected thread ``` ## What changed - Install the selected-executor-plugin MCP contributor in app-server using the existing shared `EnvironmentManager`. - Initialize its frozen thread snapshot when `thread/start` includes selected capability roots. - Document that selected plugin stdio MCPs are activated in their owning environment. - Add an app-server E2E covering the complete selection-to-tool-call path. The E2E verifies that: - the selected MCP process receives an executor-only environment value, proving the tool runs through the selected environment; - the MCP tool is advertised to the model and can be called; - a normal MCP config reload does not discard the thread's frozen selected-plugin registration; - another thread without the selected root does not see the MCP server. ## Scope - Existing sessions without `selectedCapabilityRoots` are unchanged. - Only stdio MCP declarations are activated. HTTP declarations remain inactive. - This does not change selected-root persistence across resume/fork or add hosted-plugin behavior. ## Verification - Focused app-server E2E: `selected_executor_plugin_exposes_its_stdio_mcp_only_to_that_thread` ## Stack Stacked on #27870.
26 lines
905 B
Python
26 lines
905 B
Python
load("//:defs.bzl", "codex_rust_crate")
|
|
|
|
codex_rust_crate(
|
|
name = "app-server",
|
|
crate_name = "codex_app_server",
|
|
extra_binaries = [
|
|
"//codex-rs/bwrap:bwrap",
|
|
],
|
|
extra_binaries_non_windows = [
|
|
"//codex-rs/cli:codex",
|
|
"//codex-rs/rmcp-client:test_stdio_server",
|
|
],
|
|
integration_test_timeout = "long",
|
|
test_shard_counts = {
|
|
# Note app-server-all-test has a large number of integration tests, so
|
|
# even a single shard can be quite slow. When there is a legitimate
|
|
# test failure in a shard, it will still get run 3x in total, which
|
|
# can cause us to exhaust our CI timeout if the shard happens to run
|
|
# long. Using a higher shard count for app-server-all-test should help
|
|
# mitigate this risk.
|
|
"app-server-all-test": 16,
|
|
"app-server-unit-tests": 8,
|
|
},
|
|
test_tags = ["no-sandbox"],
|
|
)
|