fix(provider-acp): ignore hangups on the bb-bridge TCP socket - #2510
Open
Danielalnajjar wants to merge 1 commit into
Open
fix(provider-acp): ignore hangups on the bb-bridge TCP socket#2510Danielalnajjar wants to merge 1 commit into
Danielalnajjar wants to merge 1 commit into
Conversation
0.40's initialize ping opens a one-shot local TCP connection, then both sides hang up. The client already listens for socket errors; the server did not, so Node treated a normal reset as a process crash and killed every ACP session on that provider process. Listen for error on accepted sockets and drop it. A later tool call still works. No host-daemon protocol bump. Fixes get-bb#2509 Verification: - Test failed on unfixed main with uncaught write EPIPE. - pnpm exec turbo run typecheck test --filter=@bb/provider-bridge-acp — 289 passed.
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.
Human comments
I made a plugin to let me run workflows/children with multiple claude subscriptions at the same time (each sub is a different acp provider logged in with the 1yr token). It started failing when I updated to .40. The agent investigated and this seems like an issue that could affect more then my specific workflow so I asked it to file an issue and PR.
What was wrong
On 0.40,
bb-bridgeopens a short local TCP connection at initialize to say it started, then both sides hang up. The client already listens for socket errors. The server did not, so Node treated a normal hangup as a crash and killed the ACP provider process — every session on that process died with it. 0.39 never sent that initialize ping, so session start did not hit this.See #2509.
What changed
In
packages/provider-bridge-acp, listen forerroron acceptedbb-bridgesockets and ignore it. These connections are one-shot; a reset after the reply is normal.Added a regression test that resets the client right after initialize, asserts the process does not throw, then makes a real tool call on the same server.
No
HOST_DAEMON_PROTOCOL_VERSIONbump: this is inside the ACP provider process, not the server/host-daemon wire. No CLI or docs change.How you verified
The new test
keeps the dynamic-tool TCP server alive after a client reset on initializefailed on unfixedmainwith uncaughtwrite EPIPE, then passed after the listener.pnpm exec turbo run typecheck --filter=@bb/provider-bridge-acppnpm exec turbo run test --filter=@bb/provider-bridge-acp— 289 passedFixes #2509