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
Suppress JSON-RPC writer rejections during client teardown
forceStop()/stop() dispose the JSON-RPC connection and destroy the underlying
socket. If vscode-jsonrpc still has an in-flight write at that moment — most
commonly the auto-generated response to a server->client request (a tool, hook,
userInput, or LLM-inference handler that resolved just before teardown) — the
write rejects with ERR_STREAM_DESTROYED. That response write is internal to
vscode-jsonrpc and awaited by nobody, so the rejection surfaces as an unhandled
promise rejection (observed intermittently in the e2e suite, originating from
pending_work_resume's cold-resume forceStop path, but reproducible by any
consumer that forceStop()s while a server->client request is in flight).
Wrap the StreamMessageWriter so write failures can be swallowed, but only once
a teardown-in-progress flag is set immediately before connection.dispose(). The
writer still fires its error event (forwarded to MessageConnection.onError) and
dispose() still rejects pending requests, so no signal is lost. Outside teardown
the flag stays false, so write failures propagate normally and in-flight
requests continue to fail fast.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments