Skip to content

fix(acp): route MCP requests by server ID, not session attribution - #529

Merged
benbrandt merged 1 commit into
mainfrom
fix/mcp-session-routing-528
Nov 25, 2026
Merged

benbrandt merged 1 commit into
mainfrom
fix/mcp-session-routing-528

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Fixes #528.

In v1, an attached MCP provider and an active session could both claim an mcp/message request when its sessionId matched the active session. Whichever handler ran first won. If the session won and its update stream was unread, the caller timed out without the provider ever seeing the request.

With unstable_mcp_over_acp enabled, session handlers and the v1 retry path no longer use sessionId to route mcp/message. The provider is selected by serverId and still receives the original attribution for its admission decision. Other session traffic and handler ordering are unchanged.

Verification

  • Reproduced the v1 timeout before the fix with the active session stream open but unread.
  • After the fix, the admission regression passed on 30 fresh v1 and 30 fresh v2 connections: the test provider rejected the active parent with -32602 and accepted the child every time.
  • Added an order-independent regression: an unknown serverId with matching parent attribution must return -33001 rather than enter the session stream.
  • just test, cargo fmt --all -- --check, MCP-only core Clippy with -D warnings, and mdbook build passed. The downstream Go-over-stdio suite was not run.

@benbrandt
benbrandt enabled auto-merge (squash) November 25, 2026 12:34
@benbrandt
benbrandt merged commit 9f9d941 into main Nov 25, 2026
13 checks passed
@benbrandt
benbrandt deleted the fix/mcp-session-routing-528 branch November 25, 2026 12:46
This was referenced Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v1 MCP-over-ACP: requests attributed to an active session can time out

1 participant