You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Telemetry bucket 112c22ba-c8f9-9d2c-1f93-9f46466fb2ac reports SyntaxError: Unexpected end of JSON input thrown from JSON.parse inside deserialize() in src/vs/base/parts/ipc/common/ipc.ts, running in the agent host utility process (agentHostMain.js) while decoding an inbound IPC message delivered over a MessagePort. The message payload arrives truncated: the binary framing declares an object of N bytes, but fewer than N bytes are present, so JSON.parse on a partial/empty string fails with a context-free error that gives triage no way to see where the corruption happened. New in 1.133.0-insider (5a36a9c6); not present in the 1.132.0 baseline (df53daab), matching the introduction of the Agent Host Protocol-over-IPC (MessagePort) plumbing.
Ancestry could not be git-verified in this environment (blobless checkout, credentials stripped after checkout, so git show <hash> / merge-base --is-ancestor fail on on-demand object fetch). Within the 1.132.0 to 1.133.0-insider regression window, the agent-host MessagePort transport that routes these IPC messages was introduced/reworked by:
63a042819ddd4deaffd45ac84dc176d1f00bb49a — "agentHost: use AHP for local connections" (routes local renderer traffic through the Agent Host Protocol over MessagePort) — Connor Peet (@connor4312).
This is the most likely producer of the new truncated-frame path; the crash surfaces in the shared deserialize() utility rather than in the transport commit itself.
Code Flow
flowchart TD
A[MessagePortMain message event - native Electron layer] -->|e.data possibly truncated| B[Protocol.onMessage ipc.mp.ts:21-26 VSBuffer.wrap or alloc 0]
B --> C[ChannelServer.onRawMessage / onBuffer ipc.ts]
C --> D[deserialize reader ipc.ts:304]
D -->|DataType.Object| E[readIntVQL yields length N]
E --> F[reader.read N - BufferReader.slice returns fewer than N bytes, NO error on underflow]
F --> G[JSON.parse of partial string ipc.ts:322]
G -->|SyntaxError: Unexpected end of JSON input| H[telemetry bucket 112c22ba]
Loading
Affected Files
src/vs/base/parts/ipc/common/ipc.ts — deserialize()DataType.Object case (crash site and where the truncation first becomes observable). BufferReader.read() (lines 217-221) slices without erroring on underflow, so a short buffer silently yields a partial string.
Repro Steps
Deterministic user repro is not available (the truncation originates in the native MessagePort/utility-process boundary during agent host connect/disconnect, not in reproducible TS logic). Observed across Windows/Mac/Linux, 44 users, on 1.133.0-insider. Conceptually: deliver a MessagePort frame to the agent host whose binary object header declares more bytes than the payload actually contains (e.g. a partial/racing frame during agent host teardown) and deserialize will attempt JSON.parse on a truncated string.
How the Fix Works
Chosen approach — src/vs/base/parts/ipc/common/ipc.ts, deserialize()DataType.Object case (the bypass site is ipc.ts:322, where reader.read(N) can return fewer than N bytes without error because BufferReader.read slices without bounds-checking). Before calling JSON.parse, read the declared length N and the actual buffer, and if the buffer is shorter than declared, throw an enriched error naming the expected vs. received byte counts. This follows the cross-process-error principle: enrich the error with diagnostic context, do not swallow it. The error is still thrown and still reaches the telemetry pipeline, but the new bucket will carry actionable framing information (expected N, received M) instead of an opaque Unexpected end of JSON input, letting the transport owner see truncation is occurring and where. This does not add a try/catch, does not remove any logService.error, and does not coerce the bad value to a benign default — the corrupt frame is still rejected loudly.
Alternatives considered
Wrap JSON.parse in try/catch and return undefined/empty object — rejected: swallows a real cross-process corruption, hides the producer, and breaks the telemetry signal that surfaced the bug.
Drop empty/short messages at the producer in Protocol.onMessage (ipc.mp.ts) — rejected as the primary fix: the true producer is the native MessagePort layer (not visible in TS), the exact truncation condition isn't reconstructable from source, and silently dropping frames there would mask the corruption for every channel without diagnostics. Enriching at the deserialization boundary keeps the signal while making it diagnosable for whichever transport is at fault.
Recommended Owner
@connor4312 — authored the 1.133 Agent Host Protocol-over-MessagePort IPC plumbing (63a042819dd, "agentHost: use AHP for local connections") that introduced the new transport path in which this error appears.
Original error: ERR_API: [2026-08-11T15:29:09.168Z] create pull request in microsoft/vscode failed (attempt 1)
Original error: Validation Failed: {"resource":"PullRequest","code":"custom","field":"fork_collab","message":"fork_collab Fork collab can't be granted by someone without permission"} - https://docs.github.com/rest/pulls/pulls#create-a-pull-request
Retryable: false
Suggestion: This error cannot be resolved by retrying. Please check the error details and fix the underlying issue.
Summary
Telemetry bucket
112c22ba-c8f9-9d2c-1f93-9f46466fb2acreportsSyntaxError: Unexpected end of JSON inputthrown fromJSON.parseinsidedeserialize()insrc/vs/base/parts/ipc/common/ipc.ts, running in the agent host utility process (agentHostMain.js) while decoding an inbound IPC message delivered over a MessagePort. The message payload arrives truncated: the binary framing declares an object of N bytes, but fewer than N bytes are present, soJSON.parseon a partial/empty string fails with a context-free error that gives triage no way to see where the corruption happened. New in1.133.0-insider(5a36a9c6); not present in the1.132.0baseline (df53daab), matching the introduction of the Agent Host Protocol-over-IPC (MessagePort) plumbing.Fixes #330263
Recommended reviewer:
@connor4312Culprit Commit
Ancestry could not be git-verified in this environment (blobless checkout, credentials stripped after checkout, so
git show <hash>/merge-base --is-ancestorfail on on-demand object fetch). Within the1.132.0to1.133.0-insiderregression window, the agent-host MessagePort transport that routes these IPC messages was introduced/reworked by:63a042819ddd4deaffd45ac84dc176d1f00bb49a— "agentHost: use AHP for local connections" (routes local renderer traffic through the Agent Host Protocol over MessagePort) — Connor Peet (@connor4312).This is the most likely producer of the new truncated-frame path; the crash surfaces in the shared
deserialize()utility rather than in the transport commit itself.Code Flow
flowchart TD A[MessagePortMain message event - native Electron layer] -->|e.data possibly truncated| B[Protocol.onMessage ipc.mp.ts:21-26 VSBuffer.wrap or alloc 0] B --> C[ChannelServer.onRawMessage / onBuffer ipc.ts] C --> D[deserialize reader ipc.ts:304] D -->|DataType.Object| E[readIntVQL yields length N] E --> F[reader.read N - BufferReader.slice returns fewer than N bytes, NO error on underflow] F --> G[JSON.parse of partial string ipc.ts:322] G -->|SyntaxError: Unexpected end of JSON input| H[telemetry bucket 112c22ba]Affected Files
src/vs/base/parts/ipc/common/ipc.ts—deserialize()DataType.Objectcase (crash site and where the truncation first becomes observable).BufferReader.read()(lines 217-221) slices without erroring on underflow, so a short buffer silently yields a partial string.Repro Steps
Deterministic user repro is not available (the truncation originates in the native MessagePort/utility-process boundary during agent host connect/disconnect, not in reproducible TS logic). Observed across Windows/Mac/Linux, 44 users, on
1.133.0-insider. Conceptually: deliver a MessagePort frame to the agent host whose binary object header declares more bytes than the payload actually contains (e.g. a partial/racing frame during agent host teardown) anddeserializewill attemptJSON.parseon a truncated string.How the Fix Works
Chosen approach —
src/vs/base/parts/ipc/common/ipc.ts,deserialize()DataType.Objectcase (the bypass site isipc.ts:322, wherereader.read(N)can return fewer than N bytes without error becauseBufferReader.readslices without bounds-checking). Before callingJSON.parse, read the declared length N and the actual buffer, and if the buffer is shorter than declared, throw an enriched error naming the expected vs. received byte counts. This follows the cross-process-error principle: enrich the error with diagnostic context, do not swallow it. The error is still thrown and still reaches the telemetry pipeline, but the new bucket will carry actionable framing information (expected N, received M) instead of an opaqueUnexpected end of JSON input, letting the transport owner see truncation is occurring and where. This does not add atry/catch, does not remove anylogService.error, and does not coerce the bad value to a benign default — the corrupt frame is still rejected loudly.Alternatives considered
JSON.parseintry/catchand returnundefined/empty object — rejected: swallows a real cross-process corruption, hides the producer, and breaks the telemetry signal that surfaced the bug.Protocol.onMessage(ipc.mp.ts) — rejected as the primary fix: the true producer is the native MessagePort layer (not visible in TS), the exact truncation condition isn't reconstructable from source, and silently dropping frames there would mask the corruption for every channel without diagnostics. Enriching at the deserialization boundary keeps the signal while making it diagnosable for whichever transport is at fault.Recommended Owner
@connor4312— authored the 1.133 Agent Host Protocol-over-MessagePort IPC plumbing (63a042819dd, "agentHost: use AHP for local connections") that introduced the new transport path in which this error appears.Note
This was originally intended as a pull request, but PR creation failed. The changes have been pushed to the branch
fix/ipc-truncated-object-deserialize-330263-c312214413ed2ef7.Original error: ERR_API: [2026-08-11T15:29:09.168Z] create pull request in microsoft/vscode failed (attempt 1)
Original error: Validation Failed: {"resource":"PullRequest","code":"custom","field":"fork_collab","message":"fork_collab Fork collab can't be granted by someone without permission"} - https://docs.github.com/rest/pulls/pulls#create-a-pull-request
Retryable: false
Suggestion: This error cannot be resolved by retrying. Please check the error details and fix the underlying issue.
To create the pull request manually:
gh pr create --title "fix: enrich truncated IPC object deserialize error (fixes #330263)" --base main --head vscodebot-pr:fix/ipc-truncated-object-deserialize-330263-c312214413ed2ef7 --repo microsoft/vscodeShow patch (39 lines)