Pin forwarding tools/call against a stale-Legacy stateless backend - #6010
Merged
Conversation
JAORMX
requested review from
ChrisJBurns,
amirejaz,
jerm-dro,
jhrozek and
tgrunnagle
as code owners
July 27, 2026 11:47
Part of #5992. The 'stale Legacy cache is harmless' property was pinned only for ListCapabilities (forwarding=false). The forwarding tools/call path is the risky arm: binding forwarders makes newStreamableHTTPClient enable WithContinuousListening, whose standalone server->client GET stream is what made the pooled session-factory connect fail against a session-less backend in #6006. The per-call path survives because go-sdk's streamableClientConn opens that stream only when the negotiated protocol is < 2026-07-28, and the SDK's Modern-first client negotiates Modern on the mis-cached-Legacy hop — suppressing the stream entirely. legacyInit then flips the cache to Modern in-band. Pin it against a real stateless go-sdk backend so a regression in that version gate surfaces here, not in production.
JAORMX
force-pushed
the
test/5992-forwarding-cached-legacy
branch
from
July 27, 2026 11:52
aded70e to
079ddc0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6010 +/- ##
==========================================
- Coverage 72.15% 72.08% -0.07%
==========================================
Files 720 720
Lines 74744 74744
==========================================
- Hits 53929 53879 -50
- Misses 16942 17010 +68
+ Partials 3873 3855 -18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rdimitrov
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #5992. That issue's headline problem — a Legacy-cached backend redeployed stateless/Modern staying pinned
Legacyforever — was fixed in #5997 (legacyInitreads the genuinely-negotiated protocol version off everyInitializeResultand flips the cache in-band, pinned byTestListCapabilities_MisCachedLegacy_SelfHealsViaSDKNegotiation). #6002 re-scoped the TTL re-probe as an open question, not requested work.What remained from the issue body is the "also worth a test" half:
This adds that test.
Why the forwarding arm is the one worth pinning. Binding forwarders makes
newStreamableHTTPClientenabletransport.WithContinuousListening(), which opens the standalone server→client GET stream. Opened against a session-less backend, that stream is exactly what made the pooled session-factory connect fail in #6006 (subscriptions/listen→ "session not found"). The per-call legacy path survives because go-sdk'sstreamableClientConn.sessionUpdatedopens that stream only when the negotiated protocol is< 2026-07-28(mcp/streamable.go:2096) — and the SDK's Modern-first client negotiates Modern on the mis-cached-Legacy hop, so the gate suppresses the stream entirely.legacyInitthen flips the cache to Modern in-band.A regression in that version gate (or a shim change opening the stream unconditionally) would break only this forwarding path — invisible to the existing
ListCapabilitiespin. This test makes it fail loudly.Type of change
Test plan
task test) — fullpkg/vmcp/clientpackage green with-racetask lint-fix)TestCallTool_MisCachedLegacy_ForwardingAgainstStatelessBackend: binds stub forwarders, mis-caches Legacy against a real stateless (Modern) go-sdk backend, drives the forwardingCallTool, and asserts both the successful round-trip and the in-band cache flip to Modern. The harness dependency (factoryConnect+legacyInit) is the exact path #6006 proved fatal without the gate, so the pin is non-vacuous.API Compatibility
v1beta1API.No production code changed.
Does this introduce a user-facing change?
No.