Repository navigation
Description
Summary
When a running ACP agent process exits, bb converts the exit into error events but has no recovery path. Every subsequent turn.submit in the thread fails with No active ACP session; the only recovery is creating a new thread.
Steps to reproduce
- Start a thread against an ACP agent (long-running bridge binary).
- Kill the agent process externally (
kill <pid>— clean SIGTERM; agent exits 0). - bb reports
Provider "…" exited unexpectedly with code 0and marks the turn failed. - Send a message in the same thread →
Command turn.submit failed: No active ACP session. Repeatable; no respawn occurs.
Expected vs actual
Expected: the next turn.submit after an agent exit relaunches the agent and re-provisions the session — via session/load where the agent advertises loadSession, so thread history survives the agent restart. At minimum, surface an explicit recovery action instead of a dead-end error.
Actual: every subsequent submit returns -32000 "No active ACP session" (bridge.ts#L2742–L2769); no respawn occurs; the only recovery is creating a new thread.
Source
All references pinned to bb main @ 0bd81a2 (2026-10-05).
buildUnexpectedProviderExitEventsreceivesAgentRuntimeProcessExitInfo— includingcode/signaland the affected threads — and emits only error events:runtime-manager.ts#L1066–L1110→system/errorwithcode: "provider_process_exited"(L1080, L1104) andturn/completed (failed). No relaunch, no re-provision; the dispatcher runs it at L1233.- The dead-end:
bridge.ts#L2742–L2769returns-32000 "No active ACP session"for turn submission, and L387 does the same for dynamic tool calls — whenever the session is gone. formatProviderProcessExitStatus(runtime-manager.ts#L99–L109) already distinguishessignalvscode— the clean-exit-vs-crash signal exists at the source but is used only for the exit message string (L114).
Preempting "exit 0 = intentional shutdown"
A client-initiated close travels the session/end path, not an unexpected-exit event. From a live thread's perspective, any exit event — including a clean exit 0 — means the thread's agent is gone and the thread is unrecoverable as-is. The code/signal distinction bb already tracks could additionally route crashes (signal, non-zero) to a louder warning.
What you ruled out
- Bridge-side fault: the agent's own log shows a clean, intentional shutdown with no error preceding the exit — the process was killed externally during normal use, not failing.
- Not ACP provider process dies after bb-bridge initialize hangup #2509 (closed): that covers an initialize hangup causing agent death — the cause, not the missing recovery.
- Not Third-party provider bridge: silent delta-batch drops, undocumented required fields, and worker process leak #3820: delta drops and worker leaks — a different surface.
Environment
bb desktop 0.45.0, macOS 27.0.1. Agent: acp-bridge (a fork of BlakeHung/acp-bridge) at d261ed1; clean SIGTERM exit by design.
Activity
bb-slop-cop commentedon Oct 5, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Bug · High priority · Medium effort. Labels:
providers,host,provider-acp,confirmed-repro.Report: https://get-bb.github.io/reports/issues/4939.html
Verdict: REPRODUCED · high confidence, confirmed in a second clean trusted checkout.
Root cause: Unexpected ACP child exits delete saved session reconstruction state. Premature active-prompt cleanup also prevents failed-turn emission, leaving interrupted runtime turns active. The report distinguishes this child-exit path from the outer bridge’s host exit event.
Fix: #4947 — ready, not merged; 126 changed text lines across two ACP files. Seven regression cases fail before and pass after; 680 relevant tests pass, plus typechecks, lints, and real runtime recovery checks.
Restore ACP sessions after unexpected agent exits (#4947)