Repository navigation
fix(mcp): keep links from stale-session recovery and other review follow-ups - #2761
Closed
mattzcarey wants to merge 3 commits into
Closed
mattzcarey wants to merge 3 commits into
mattzcarey wants to merge 3 commits into
Conversation
|
Contributor
|
✅ agents import sizes: no significant changes ( |
agents
@cloudflare/ai-chat
@cloudflare/codemode
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
mattzcarey
force-pushed
the
fix/mcp-review-followups
branch
from
October 29, 2026 11:52
d6524e2 to
bcf6758
Compare
mattzcarey
force-pushed
the
fix/mcp-review-followups
branch
from
October 29, 2026 18:59
8148f2d to
0c86c06
Compare
…y errors, refresh once for late 401s - a resumed session the server forgot, restarted into OAuth, kept its link only in the connection; discovery now returns it, so the server waits for the user instead of being recorded as refused - a failure that schedules a reconnect sets the connection's error, so addMcpServer() and getMcpServers() report it instead of "Connection failed" - a 401 compares against the token its own request carried, so one arriving after another request refreshed retries with the new token instead of refreshing again; warn if the SDK stops exposing its auth provider - an auth-expiry job without savedAt expires its link on the next run - shorter changeset for reconnectMcpServer
mattzcarey
force-pushed
the
fix/mcp-review-followups
branch
from
October 29, 2026 19:28
0c86c06 to
3f5beb7
Compare
Member
Author
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.
Fixes the last review findings on the stack. The worst: a resumed session the server had forgotten, when restarted into OAuth, was recorded as
authorization-failedinstead of waiting for the user with a working link. Three smaller fixes come with it: a server waiting for a scheduled reconnect reports its real error, a late401reuses a token another request just refreshed, and old link-expiry jobs can't stall.Stacked on #2760, part of the work on #2658. Details:
addMcpServer()andgetMcpServers()show it instead of "Connection failed".401s: a smallfetchwrapper records the token each401was sent with. If a newer token exists by the time that request's turn comes, the SDK retries with it instead of refreshing again. The manager also warns once if the SDK stops exposing the auth provider the turns wrap.savedAt: they count as old, so their link expires at the next run. Only this unreleased stack wrote such jobs, but this is cheap insurance if feat(mcp): durable reconnect and authorization-expiry jobs #2662 ships before fix(mcp): stop MCP recovery from retrying or minting links on its own #2758.pnpm run checkand the full agents suite pass. New tests cover the stale-session case and the error message, and both fail without the fix.