Skip to content

provider-acp: omp session_busy prompt rejections fail the turn and re-send in a loop (busy with no ACP turn) #3009

Closed

Description

@bradhallett

Summary

Sending a message to an acp-omp thread at the wrong instant — steering into the final second of a turn, or sending while omp is still finishing internal (non-ACP) work — makes omp reject session/prompt with its typed session_busy error. The provider-acp bridge has no path for that typed rejection, so the turn fails, and every re-send fails the same way until bb's client-side request timeout (~8 min) expires. Mid-flight steers that land before the completion instant work fine; only the completion-instant / post-completion window rejects.

Versions and environment

  • bb 0.41.1-nightly.33639578859.1 (desktop app, macOS arm64, arm64 host). main at debb58d is equally affected: git grep session_busy -- packages/provider-bridge-acp returns nothing.
  • Provider acp-omp: omp 18.1.6 (Homebrew). Earlier storms observed on 17.4.x/18.0.x (before the error was typed).
  • Codex threads are unaffected (38 audited, zero failures of this shape).

Steps to reproduce

Timing-dependent in production (a completion-instant race) — hit 11+ times across 3 threads over 3 days of normal use. The wire-level failure is deterministic and covered by unit tests in the fixing PR, whose fake ACP agent emits omp's exact rejection shape:

  1. Connect bb to omp acp and start a turn long enough to steer into (30–60 s).
  2. In the final second of that turn, send a steer: bb thread tell <thread-id> "...".
  3. Immediately after the turn completes, send another message.
  4. Intermittently, every send returns the error below, the turn completes failed, and dispatch re-sends in a tight loop. Observed cadence: rejection at +3 ms after turn/input/accepted, next turn started +23 ms later; worst storm 8 rejections over 105 s until bb's ~8-minute client timeout.

Expected vs actual

Actual (verbatim, per rejected send):

Agent is already processing. Use steer() or followUp() to queue messages, or wait for completion.: {"reason":"session_busy","hint":"steer|followUp|wait"}

Expected: the send joins the thread queue with waitingOn.kind: "thread-busy" and dispatches once the agent goes idle — bb's documented queue contract for a busy thread — instead of failing the turn and storming retries.

Evidence

  • Thread thr_8er33e2aiv, 2026-08-23 00:22:12 UTC: seq 7316 turn/started → seq 7317 provider/error (above) at +3 ms → seq 7318 turn/completed status:"failed"; retry turn t18 started +23 ms later. Three such bursts in that thread's log (seq 7317, 7321 region through 48133).
  • Threads thr_5esghkmr5x (8 rejections 04:04–04:05 UTC over 105 s; a 07:43:49 recurrence is that thread's last event ever — status stuck error) and thr_4tm7g4ie78 (×3, 07:01–07:05). In the 2026-08-20→22 audit of 45 threads, 11 of 14 real provider errors across omp threads carried this exact signature; the diagnosis is Issue 1 of the integration post-mortem produced in thread thr_cz6spq5br5.
  • omp side (main @ 6b367ec7b): the ACP layer only queues/implicit-cancels when an ACP-owned turn is in flight (acp-agent.ts#L821-L840). When the session is busy with no ACP turn — the completion instant, or deferred agent-initiated continuations (provider-acp silently drops agent-initiated turns (unprompted session updates, e.g. OMP async-job delivery) #2122/provider-acp: no consumption path for agent-wake notifications — ACP agents with settled background work can't be resumed (OMP async-job delivery) #2461) — the prompt falls through to a bare record.session.prompt(text, { images }) (acp-agent.ts#L1028) which throws AgentBusyError, deliberately typed for the wire as -32003/session_busy since omp#9825 (acp-agent.ts#L871-L886). Over ACP the host cannot act on the steer|followUp hint: steering is session/prompt, which is exactly what got rejected.
  • bb side (main @ debb58d10): the typed error falls into the bridge's generic error path — turn failed, error notification emitted, dispatch retries.

What I ruled out

Suggested priority and effort

High pain when hit (thread wedged in error, messages unsendable for minutes; one thread terminally stuck), moderate frequency for omp users who steer near turn boundaries. Workaround today: bb thread stop then re-send, or wait out the ~8-minute timeout. Fix is contained to the bridge's turn loop.

AGENT GENERATED

Activity

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

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · High priority · Low effort
    • Labels: providers, provider-acp, confirmed-repro
    • Report: direct reproduction and root-cause report
    • Verdict: REPRODUCED · confidence: high
    • Root cause: The ACP bridge discards typed error data. It routes a temporary busy response through the general turn-failure path.
    • Reproduction: Two clean checkouts received a failed turn after the test agent returned the typed busy response.
    • Pull request: No new pull request was safe because PR #3004 already targets this defect.
  4. bottlebrushes commented on Oct 1, 2026

    @bottlebrushes
    Contributor

    Still reproduces on bb 0.43.4 + omp 18.4.3 (Linux x64). The installed provider-acp/dist/host.js still has no session_busy handling. Note that #3004, which the triage bot cited as the reason not to open a new PR, was auto-closed unmerged on 2026-09-18 by the stale-PR rule. Nothing open targets this now.

    New trigger, not covered in the report: an IRC message from a subagent. This was not an async-job completion, and not a completion-instant race. Sequence (local time, thread event log + omp session transcript):

    1. 10:30:00: a long turn spawns background task subagents. The main agent then blocks in wait.
    2. 10:56:02: the user's message arrives mid-turn. bb's steer path sends session/cancel and re-prompts, which aborts the wait ("Operation aborted"). The agent answers, and turn/completed arrives at 10:56:16 with the subagents still running.
    3. 10:57:03: subagent DecodeAccess sends an irc:incoming message. omp wakes the main agent with no ACP turn. It writes back to the subagent and enters wait again. bb receives zero events (event log jumps from seq 2641 to 2642).
    4. 10:57:53, 10:58:03, 10:58:18: three user sends, each rejected within ~10 ms with the typed session_busy. Each turn is failed and the thread is left in error.
    5. 10:59:12: bb thread stop → omp gets SIGTERM with the wait still pending. The resend then succeeds.

    Why this matters for the fix: the window was ~97 s after completion. That was ordinary user pacing, not a sub-second race. It is opened by bb's own steer semantics: cancelling the owning prompt leaves subagents alive, and any one of them can wake the agent later. A plain retry would have had to wait until WallisCollection finished, which takes minutes. So the queue-until-idle behaviour in "Expected" (waitingOn.kind: "thread-busy") is what's needed, not a short retry backoff.

  5. ComicBit commented on Oct 5, 2026

    @ComicBit
    Contributor

    Independent recurrence on a separate project/thread

    This reproduced in a separate iw4L project with a normal user turn. BB had recorded the preceding turn as completed, then accepted a new turn; ACP-OMP rejected it with the same typed session_busy error and BB marked the new turn failed. Stopping the thread and retrying restored the session.

    Versions and environment

    • BB CLI: 0.45.0
    • Reporting client: macOS 26.7.1, arm64
    • Provider: acp-omp; the thread ran on remote host host_fzdx8fkmqu, and its remote OMP version was not captured
    • Project: proj_xby4suzwdk (iw4L)
    • Thread: thr_wmpwvc7yip
    • Environment: env_5t296y4pnn

    Evidence

    • Event seq 505: previous provider turn daf98e33f9-t3 was recorded as turn/completed with status completed.

    • Event seq 506: a new user request was submitted.

    • Events seq 507–508: BB started and accepted provider turn daf98e33f9-t4 on provider thread 01a10ccb-432d-7049-9cf2-5c789c43bb9c.

    • Event seq 509:

      Agent is already processing. Use steer() or followUp() to queue messages, or wait for completion.: {"reason":"session_busy","hint":"steer|followUp|wait"}
      
    • Event seq 510: BB completed daf98e33f9-t4 with status failed.

    • Event seq 511: BB emitted the same message as a provider warning.

    • Manual recovery with bb thread stop thr_wmpwvc7yip followed by bb thread retry thr_wmpwvc7yip succeeded on retry attempt 2.

    • Events seq 515–518: fresh turn da9ff2b79c-t1 started and executed a command successfully.

    The preceding turn completion and the next request were separated by about 8 minutes, so this is not limited to a sub-second completion-boundary race. It demonstrates that OMP can remain busy after BB records the prior turn completed, including for a normal new user turn.

    What this adds

    This is an independent recurrence of the issue on another project and provider session. The current workaround is operational only: stop the thread, then retry. Expected behavior is to reconcile or queue/wait on the provider's busy state rather than fail the turn and require manual recovery.

    Thread: thr_wmpwvc7yip

    AGENT GENERATED

  6. added a commit that references this issue on Oct 10, 2026
    fe1a02d
  7. doonto commented on Oct 24, 2026

    @doonto

    After updating BB to 0.47.0 yesterday, I reproduced the same session_busy failure with OMP 18.12.6.

    The failing prompt was not typed by the user. BB's event log shows it as an agent-originated client/turn/requested (source: tell, initiator: agent): an automatic message from a parent thread to its child. The child turn then surfaced:

    Agent is already processing. Use steer() or followUp() to queue messages, or wait for completion.: {"reason":"session_busy","hint":"steer|followUp|wait"}

    The turn was recorded as failed. BB 0.47.0's bundled provider-acp contains the -32003 / data.reason === "session_busy" handling and quiet-wait retry logic. The thread event log does not expose the bridge's internal retry count, so I cannot tell whether all retries were exhausted or why the session was not considered idle.

    Could this issue be reopened to investigate why the retry handling still ends in a failed turn when the incoming prompt is an automatic agent-to-agent message? This is a post-fix reproduction of the same ACP/OMP session_busy failure, rather than a user manually steering at the end of a turn.

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-reproprovider-acpproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions