mcp: retain spawn configs so reconnect works for ephemeral/managed/builtin servers - #15535
Draft
Legoben wants to merge 1 commit into
Conversation
Contributor
Author
This was referenced Aug 25, 2026
Draft
mcp: re-mint expired managed proxy tokens on demand instead of failing or misrouting to OAuth
#15538
Draft
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Problem
reconnect_serveronly looked up installations inlocally_installed_servers, so every ephemeral server — managed (backend-proxied), file-based, CLI-run (oz agent run --mcp), and the built-in Factory MCP — failed reconnection permanently with"Installation not found"the moment its transport closed. The spawn consumes the installation and nothing retained it; CLI-ephemeral installs are the only carrier of resolved secrets, so the config couldn't be re-derived either.Changes
spawn_configsretention: the manager keeps the exact installation each server instance was spawned with (RetainedSpawnConfig+SpawnProvenance), inserted on every spawn and removed on shutdown/delete. Entries hold resolved secrets/proxy tokens and are never logged.respawnable_config): consults retained configs first; locally installed servers prefer the live installation (the user may have edited it); the built-in server re-mints its bearer from current session credentials. Gated behind the newMcpSelfHealfeature flag — flag off is exactly today's behavior (covered by tests).RunningServiceis now cancelled during reconnect instead of dropped un-awaited (old stdio children could linger and race the respawn);shutdown_serverfails pending reconnect waiters instead of leaking them forever (their spawn was aborted, so the completion callback never ran);authorization_urlsis cleared on reconnect (was only cleared on shutdown).Tests
cargo test -p warp --lib ai::mcp— new in-crate tests cover per-provenance lookup, the live-installation preference, builtin re-mint failure without credentials, waiter drain on shutdown, and flag-off behavior preservation.Part of the MCP self-healing stack (see stacked PRs above/below in Graphite).