Skip to content

ACP agent exit is detected (provider_process_exited) but never recovered — turn.submit fails with "No active ACP session" until a new thread is created #4939

Closed

Description

@anesthetised

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

  1. Start a thread against an ACP agent (long-running bridge binary).
  2. Kill the agent process externally (kill <pid> — clean SIGTERM; agent exits 0).
  3. bb reports Provider "…" exited unexpectedly with code 0 and marks the turn failed.
  4. 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).

  • buildUnexpectedProviderExitEvents receives AgentRuntimeProcessExitInfo — including code/signal and the affected threads — and emits only error events: runtime-manager.ts#L1066–L1110 → system/error with code: "provider_process_exited" (L1080, L1104) and turn/completed (failed). No relaunch, no re-provision; the dispatcher runs it at L1233.
  • The dead-end: bridge.ts#L2742–L2769 returns -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 distinguishes signal vs code — 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

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

  1. added theissue type on Oct 5, 2026
  2. added
    providers
    host
    provider-acp
    confirmed-repro
    on Oct 5, 2026
  3. bb-slop-cop commented on Oct 5, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classification: 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.

    AGENT GENERATED

  4. added a commit that references this issue on Oct 5, 2026
    be68bf3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reprohostprovider-acpproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions