Reuse MCP runtimes when selected availability changes nothing#30148
Merged
Conversation
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40e7b8face
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
sayan-oai
approved these changes
Jun 26, 2026
40e7b8f to
7da42a5
Compare
…se-unchanged-mcp-projection
…se-unchanged-mcp-projection
9420863 to
c38d428
Compare
Base automatically changed from
jif/selected-capability-stack-integration
to
jif/fallback-remote-filesystem-walk
June 26, 2026 01:46
…se-unchanged-mcp-projection
…se-unchanged-mcp-projection
Base automatically changed from
jif/selected-capability-stack-integration
to
main
June 26, 2026 02:11
This was referenced Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
MCP runtime reuse was keyed by every ready selected-capability environment, even when an environment contributed no MCP servers or connectors.
For example:
That restart can interrupt active calls and discard process-local state even though nothing about MCP changed.
What changes
When selected-environment availability changes, Codex now resolves the candidate MCP and connector projection before deciding whether to replace the runtime:
The comparison uses the resolved winning servers and their sources, so plugin/config ownership remains part of the runtime identity.
Existing stack coverage
The integration PR directly below this one already covers both rebuild boundaries: a selected MCP becomes callable and a selected connector tool becomes model-visible when their environment becomes available. It also verifies that an unchanged selected MCP runtime keeps its process.
This PR does not add another remote-attachment integration scenario for the no-change optimization.
environment/addreturns before readiness, and app-server does not currently expose a deterministic readiness signal for an environment that contributes only skills. Keeping a fixed-delay test would add flake risk; adding a new readiness API would be outside this fix.Scope and assumptions
required = trueexecutor MCP behavior remains out of scope.