Repository navigation
fix(mcpdo): name a connection_lost abort instead of tallying [object Object] - #2868
Merged
Merged
Conversation
…Object] A --load run that loses its connection aborted its in-flight calls with the LoadStop object it hands the engine. The SDK stringifies an abort reason into the request's rejection (and its notifications/cancelled reason), so each such call was tallied as "[object Object]". In-flight requests now get their own AbortController, aborted alongside the run's but with a plain abort when the caller hangs up and a named AbortError when the connection drops. The engine's signal still carries the LoadStop, so stoppedEarly is unchanged. Closes #2866 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the cancellation-handling changes that make connection-loss errors readable.
No open issues 🎉
What changed in this PR
Fixes #2866 in mcpdo’s load-run handling so connection-loss cancellations produce readable errors instead of [object Object], while preserving the engine’s structured stop reason.
Changes:
- Separates request cancellation from the load engine’s stop signal.
- Applies the request signal to primary requests, extra connections, and connection setup.
- Updates tests to verify signal separation and readable abort reasons for connection loss and caller disconnects.
| File | Description |
|---|---|
clients/mcpdo/src/daemon/server.ts |
Adds a dedicated request abort controller with readable cancellation reasons. |
clients/mcpdo/__tests__/daemon-load.test.ts |
Verifies abort reasons and shared request-signal wiring across connections. |
Review effort: Balanced
Member
Author
|
Copilot review loop closed: round 1 (review 5771948861) was clean. It had no inline comments, no headline finding and no suppressed comments, so per |
This was referenced Nov 4, 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.
Closes #2866
Found in the v2.14.0 release smoke (#2865 / PR #2867). It is a regression from #2835 / PR #2855.
Problem
When the connection drops during an mcpdo
tools/call --loadrun, the run stops withconnection_lostas intended. However, the calls that were still in flight are tallied as[object Object]. In 2.13.0 they readAbortError: This operation was aborted.The cause:
runLoadOnClientaborted itsstopcontroller with theLoadStopobject, and the samestop.signalwas the client's ambient request signal. The SDK's requestcancel()turns an abort reason intonew SdkError(RequestTimeout, String(reason)), and usesString(reason)for thenotifications/cancelledreason too. So every in-flight call rejected with the message[object Object]. A debug patch on the built daemon confirmed this:SdkError: [object Object] … at cancel … at InspectorClient.onStatus.Fix
clients/mcpdo/src/daemon/server.tsonly:AbortController(abortRequests). It is aborted alongsidestop, but never with theLoadStop:abort(), which is anAbortError, the same as 2.13.0.new DOMException("load run stopped: <detail>", "AbortError").abortRequests.signalis used for the primary's ambient signal, for each extra connection's ambient signal, and for the extra-connection dial.stop.signal, which carries theLoadStop, sostoppedEarlyis unchanged.Tests
clients/mcpdo/__tests__/daemon-load.test.ts:DOMExceptionwhose string form isAbortError: load run stopped: the connection went disconnected.AbortError.server.tsreverted, 2 of the 18 tests fail, including the connection-drop test.Hand smoke
With the built mcpdo, I ran
mcpdo connect load --config …, thenmcpdo @load tools/call echo message:=x --load --load-concurrency 4 --load-duration 20, and killed the server 2 seconds in:Before the fix, the same run showed
4× [object Object].npm run local:gateis green (6m51s).🤖 Generated with Claude Code