Repository navigation
fix(core): make MCP errors self-describing - #52418
Merged
Merged
Conversation
rekram1-node
force-pushed
the
mcp-stream-diagnostics
branch
from
October 1, 2026 03:28
458e1d6 to
3224844
Compare
rekram1-node
force-pushed
the
mcp-stream-diagnostics
branch
from
October 1, 2026 03:37
3224844 to
33131b6
Compare
Ichinose-Kazuki
pushed a commit
to Ichinose-Kazuki/opencode
that referenced
this pull request
Oct 7, 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 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.
Summary
MCP failures often reached users and the model as messages that could not be acted on without logs, and some never reached either:
MCP server is not connected: no server name and no reason.Connection closed: a local server crashing, a remote stream dying, and an intentional close all looked the same.409) were dropped entirely because the client never setonerror.Changes:
ConnectionRefused,ENOTFOUND) when the message lacks them.Connection closed, and to the server'sfailedstatus when a live connection drops.mcp transport error. Aborts from closing and teardown failures already logged on their own are skipped.Examples, before → after:
Session-expiry handling is unchanged: only 404 and the 400 "Server not initialized" response trigger reconnection; a 409 is reported, not treated as expiry.
Verification
bun test test/mcp.test.ts test/mcp-oauth.test.tsandbun run checkpass.