go-sdk/internal
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bobo 165121e53e
jsonrpc2: wrap write error in server-closing error (#1186)
The "server is closing" error produced when a connection shuts down
because its write side failed formatted the underlying write error with
`%v`, so the cause - typically `io.EOF` when a stdio host closes its
pipe - was not part of the error chain. A caller that wants to
distinguish a clean host disconnect from a real failure via
`errors.Is(err, io.EOF)` therefore always got `false`.

This changes both `s.writeErr` wrappings to use `%w`, preserving the
write error in the error chain while keeping the same message text
("server is closing: EOF").

A regression test exercises the write-failure branch of `shuttingDown`
and asserts both `errors.Is(err, ErrServerClosing)` and `errors.Is(err,
io.EOF)`.

Fixes #1098

---------

Co-authored-by: Bo Zhang <187063395+Tethys0@users.noreply.github.com>
Co-authored-by: Guglielmo Colombo <guglielmoc@google.com>
2026-08-27 14:12:53 +00:00
..
authutil mcp: add optional issuer validator for pre-registered client validation (SEP-2352) (#946) 2026-05-29 12:46:34 +00:00
docs docs: make the protocol.md table of contents resolve (#1196) 2026-08-25 09:26:21 +02:00
json internal/json: json nesting depth check (#1200) 2026-08-27 10:47:08 +02:00
jsonrpc2 jsonrpc2: wrap write error in server-closing error (#1186) 2026-08-27 14:12:53 +00:00
mcpgodebug mcp: update JSON marshaling to not HTML-escape messages (#769) 2026-01-30 17:13:30 +01:00
oauthtest auth: validate unadvertised RFC 9207 iss instead of rejecting it (#1187) 2026-08-25 09:26:17 +00:00
readme mcp: add docs for tier 1 assessment (#1195) 2026-08-24 12:00:59 +02:00
util internal: remove unused util functions (#871) 2026-03-31 15:40:06 +02:00
xcontext x/tools: modernize interface{} -> any 2025-02-19 15:14:27 -08:00