test: cover client response posts across MCP handlers - #5885
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5885 +/- ##
==========================================
- Coverage 71.48% 71.45% -0.03%
==========================================
Files 694 694
Lines 70971 70971
==========================================
- Hits 50735 50714 -21
- Misses 16577 16598 +21
Partials 3659 3659 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ChrisJBurns
left a comment
There was a problem hiding this comment.
Test-only PR with genuine regression value for the client-response → 202 path. I applied it to current main and it passes under -race. A few small things would make it clearer/stronger:
Scope of Closes #5009: the issue's "where to fix" points at pkg/transport/proxy/streamable/ and its impact section mentions non-vMCP proxy pings too. This test only covers the vMCP server path. Can you confirm the general thv run / thv proxy streamable transport also returns 202 for client-response POSTs? If not, this closes only half of #5009 — worth either adding coverage there or noting the remaining gap on the issue before it's auto-closed.
Housekeeping: the branch is ~84 commits behind main and CI hasn't reported. Mind rebasing so the parity/lint suites run green before merge? (It still applies cleanly and passes locally, so no real conflict expected.)
|
Addressed in
The two focused tests passed under |
Signed-off-by: King Star <mcxin.y@gmail.com>
Signed-off-by: King Star <mcxin.y@gmail.com>
Signed-off-by: King Star <mcxin.y@gmail.com>
87de7eb to
c5abd68
Compare
|
Thanks for the scope check. I re-verified the ordinary transport layers and expanded the regression coverage:
I rebased onto current GOFLAGS='-run=^(TestHandler_AcceptsClientResponsePost|TestPOSTNotificationAndClientResponseAccepted|TestStreamableHTTPTransparentProxyForwardsClientResponse)$' task testA full local |
Summary
Valid JSON-RPC responses sent by Streamable HTTP clients used to pass through a
request-only authorization layer, which rejected them as malformed and broke
server-initiated MCP requests. The production vMCP handler no longer installs
that legacy layer after #5556, but the client-response path lacked end-to-end
regression coverage.
This adds coverage for the vMCP handler and the ordinary proxy layers used by
stdio
thv run,thv proxy, and remote Streamable HTTP runs.Changes
The vMCP integration test verifies that:
202 Acceptedwith an empty body;production handler chain.
The streamable proxy specification test POSTs a JSON-RPC client response and
verifies
202, an empty body, and forwarding to the destination. A complementarytransparent proxy regression exercises the ReverseProxy/RoundTrip layer used by
thv proxyand remote Streamable HTTP transport, verifying that an upstream202and empty body are preserved while the response reaches the backend.The changes are test-only and do not modify runtime behavior.
Verification
Closes #5009