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
{{ message }}
Repository navigation
Commit 9f63603
Browse filesBrowse the repository at this point in the historyBrowse files
fix: InMemoryTransport EOFs the server instead of cancelling; coverage cleanup
src/mcp/client/_memory.py: replace tg.cancel_scope.cancel() with stream
aclose(). Cancelling here throws CancelledError into the host (test's)
task; on CPython 3.11 (gh-106749) coro.throw() drops 'call' trace
events for the outer await chain, underflowing coverage's CTracer past
the test frame. Post-swap the dispatcher's empty-at-EOF inner task group
takes a one-tick fast path, so the join no longer suspends a second time
to heal via .send(). EOF teardown is equivalent (the dispatcher's run()
cancels its own in-flight handlers on read-stream EOF).
Also bundled (coverage cleanup):
- shared/session.py: delete server-only BaseSession code now unreachable
after the swap (RequestResponder.cancel/_cancel_scope/_on_complete,
CancelledNotification handling, _in_flight dict, deferred-respond
arm). ClientSession is the only remaining subclass.
- tests/client/test_session.py: add tests for the client-reachable
BaseSession paths (malformed inbound request -> INVALID_PARAMS,
sampling callback raises -> INVALID_PARAMS, progress callback
exception swallowed, malformed notification dropped, transport
exception forwarded to message_handler).
- tests/shared/test_session.py: drop test_in_flight_requests_cleared
(asserts the deleted _in_flight dict).
- tests/shared/test_dispatcher.py: add contract test for ValidationError
-> INVALID_PARAMS (covers DirectDispatcher's arm).
- tests/server/test_validation.py: cover the previous-message-has-no-
tool-use branch.
- examples/everything-server: _add_request_handler (deleted) ->
add_request_handler with explicit params type.
0 commit comments