You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mcp: log out-of-band errors instead of dropping them
Two errors that occur outside the request/response path were previously
unobservable:
- Keepalive ping failures (mcp/shared.go startKeepalive) silently
closed the session with no record of why.
- jsonrpc2 internal errors (mcp/transport.go connect) were printed
via the global log.Printf, bypassing the configured slog.Logger.
Both sites now report through the existing *slog.Logger that Server
and Client already guarantee non-nil via ensureLogger. No new public
API surface; the logger is threaded into the unexported helpers as a
parameter.
Includes a regression test (TestKeepAliveFailure_Logged) that asserts
the keepalive failure produces a log line on the configured logger,
and was verified to fail when the new log call is removed.
Per @jba's suggestion on #865, this is the smaller no-new-API
alternative to the ErrorHandler callback proposal. #865 remains open
pending community input on whether a structured callback is also
wanted.
Refs #218
0 commit comments