inspector/core/mcp/remote
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall 6cacfa3ec5 fix(core): carry the in-progress SSE frame across chunk boundaries (#2134)
parseSSE declared currentEvent/currentData inside the read loop, so an SSE
frame whose data: line arrived in one chunk and whose terminating blank
line arrived in the next was discarded. buffer already carried a partial
LINE across reads; nothing carried a partial FRAME.

Because this is the web client's transport, the dropped frame is a
JSON-RPC response that never settles: the request hangs forever with no
rejection, no console message, and nothing in the Network tab. The
payload does not arrive corrupted, it does not arrive at all, which is
why it presents as a hang rather than an error.

It has not bitten us because Chromium and Firefox happen to deliver whole
frames at the payload sizes this transport currently sees. That is luck,
not a guarantee: chunk boundaries depend on payload size, TCP
segmentation, and any intermediary. The exposure grows with payload size,
so a large resources/read is the most likely first victim.

The fix hoists both out of the loop and adds an end-of-stream flush — a
server that closes without a final blank line has still delivered a
complete frame, and dropping it would lose the last message of every such
stream.

parseSSE is now exported, solely so the test can reach it. That is the
only way to hit this deterministically: driving a real transport cannot
steer where a chunk boundary lands, but a test that supplies the reader
can put it exactly on the terminator.

The test keeps the two PASSING cases (whole frame, split mid-payload)
alongside the three that failed, because they are what make the diagnosis
precise. This is not "SSE parsing is broken" — mid-payload splits are
handled correctly today, and only the frame-terminator boundary loses
data. Verified against the unfixed code: 3 of 5 fail, all 5 pass after.

Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-25 23:59:37 -04:00
..
node Merge branch 'v2/main' into v2/fix/2096-stdio-env-cwd-revert 2026-08-25 08:55:35 -04:00
constants.ts feat(auth): inject MCP_INSPECTOR_API_TOKEN into served index.html (#1378) (#1382) 2026-05-30 20:10:27 -04:00
createRemoteFetch.ts fix(core): mirror SEP-2243 x-mcp-header args to Mcp-Param-* on tools/call (#1847) 2026-07-28 19:19:48 -04:00
createRemoteLogger.ts refactor(web): sweep AGENTS.md TypeScript + Mantine rule violations (#1771) 2026-07-25 11:38:49 -04:00
createRemoteTransport.ts test(cli,tui): typecheck the __tests__ dirs (#1791) (#1799) 2026-07-27 12:05:35 -04:00
index.ts All of the mid-session and step-up auth work 2026-07-02 16:35:31 -07:00
pino-browser.d.ts feat(core): port v1.5 InspectorClient + transports + auth subsystem (#1302) (#1306) 2026-05-15 15:36:17 -04:00
remoteClientTransport.ts fix(core): carry the in-progress SSE frame across chunk boundaries (#2134) 2026-08-25 23:59:37 -04:00
sessionStorage.ts fix(auth): persist OAuth pre-redirect Network log across the redirect (#1384) (#1385) 2026-05-30 20:39:25 -04:00
types.ts fix: forward the negotiated protocol version to the remote backend transport 2026-08-10 20:44:37 -04:00