test(mcp): stdio arm of the transport-rebuild test now expects no replay

The parametrized lifecycle test drove both transports through a
ClosedResourceError on the first call_tool and asserted a replay. For the
HTTP arm that is still the session-expired contract; for the stdio arm a
pipe closing after dispatch is now the ambiguous mid-call death and must
surface outcome_uncertain with exactly one invocation. The transport is
still rebuilt on both arms.
This commit is contained in:
teknium1
2026-09-09 04:54:14 -07:00
committed by Teknium
parent cff103a8b7
commit 9678d59c23

View File

@@ -196,8 +196,14 @@ def test_call_tool_handler_rebuilds_configured_server_transport(
handler = _make_tool_handler("resumed", "health", 10.0)
parsed = json.loads(handler({}))
assert parsed == {"result": "reconnected"}
assert call_count["n"] == 2
if expected_route == "stdio":
# A stdio pipe closing after dispatch is an ambiguous mid-call death: the transport
# is rebuilt for future calls, but the call itself is not replayed (#106440).
assert parsed["outcome_uncertain"] is True, parsed
assert call_count["n"] == 1
else:
assert parsed == {"result": "reconnected"}
assert call_count["n"] == 2
assert routes == [expected_route, expected_route]
assert configs == [transport_config, transport_config]
assert len(sessions) == 2