Skip to content

Conversation

findleyr
Copy link
Contributor

@findleyr findleyr commented Oct 6, 2025

PR 501 added logging to the streamable server, but didn't pass a non-nil logger to the streamable transport (an oversight). However, tests still passed due to net/http's panic recovery.

Update test servers to enforce that handlers do not panic, and fix the panic by:

  1. Passing along the configured logger to the session transport.
  2. Using ensureLogger in Connect, since we technically allow StreamableServerTransports to be constructed by the user.

Fixes #556

PR 501 added logging to the streamable server, but didn't pass a non-nil
logger to the streamable transport (an oversight). However, tests still
passed due to net/http's panic recovery.

Update test servers to enforce that handlers do not panic, and fix the
panic by:
1. Passing along the configured logger to the session transport.
2. Using ensureLogger in Connect, since we technically allow
   StreamableServerTransports to be constructed by the user.

Fixes modelcontextprotocol#556
@findleyr findleyr requested review from jba and samthanawalla October 6, 2025 17:27
@jba jba merged commit 547b5c1 into modelcontextprotocol:main Oct 6, 2025
5 checks passed
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.

Unit tests panic during shutdown

2 participants