Problem
readModernSSE (pkg/vmcp/client/modern.go:366-397) scans an SSE response line by line and json.Unmarshals each data: line independently. The SSE spec frames one event as all data: lines up to a blank-line boundary, joined with \n — a single JSON object may legally span multiple data: lines.
Against a conformant streamable-HTTP backend that splits its JSON that way, no single line unmarshals, readModernSSE never matches a response, and the probe falls through to errWrongEra — vMCP concludes the backend is not Modern and silently downgrades it to Legacy.
Fix
The correct algorithm already exists in-tree: sseResponsePayload (test/e2e/mcp_raw_client.go, added in #6033) accumulates data: lines to the blank-line boundary, joins with \n, skips interleaved notifications, and handles EOF without a trailing blank line. Port that into readModernSSE (with unit tests covering multi-line data:, CRLF, interleaved notifications, and EOF-without-blank-line).
Surfaced by review on #6033 (the reviewer verified the e2e helper is correct and flagged the production counterpart as the naive version). Refs #5743.
Problem
readModernSSE(pkg/vmcp/client/modern.go:366-397) scans an SSE response line by line andjson.Unmarshals eachdata:line independently. The SSE spec frames one event as alldata:lines up to a blank-line boundary, joined with\n— a single JSON object may legally span multipledata:lines.Against a conformant streamable-HTTP backend that splits its JSON that way, no single line unmarshals,
readModernSSEnever matches a response, and the probe falls through toerrWrongEra— vMCP concludes the backend is not Modern and silently downgrades it to Legacy.Fix
The correct algorithm already exists in-tree:
sseResponsePayload(test/e2e/mcp_raw_client.go, added in #6033) accumulatesdata:lines to the blank-line boundary, joins with\n, skips interleaved notifications, and handles EOF without a trailing blank line. Port that intoreadModernSSE(with unit tests covering multi-linedata:, CRLF, interleaved notifications, and EOF-without-blank-line).Surfaced by review on #6033 (the reviewer verified the e2e helper is correct and flagged the production counterpart as the naive version). Refs #5743.