Skip to content

provider-acp: no consumption path for agent-wake notifications — ACP agents with settled background work can't be resumed (OMP async-job delivery) #2461

Description

@bradhallett

1. Summary

When an ACP agent settles background work after the client-owned prompt has completed — OMP's async-job auto-delivery is the concrete case — the only v1-legal way to surface that work is a private, capability-gated notification asking the client to prompt again. OMP is preparing exactly that (option (b) in can1357/oh-my-pi#9157: initialize _meta capability + _-prefixed wake notification + parked delivery, already endorsed by two other ACP consumers). bb has no consuming half:

  • handleAgentNotification drops every notification that is not session/update — a wake has no entry point.
  • No path synthesizes a client turn on an agent's behalf: client/turn/requested has source producers only for spawn/tell.
  • activeBackgroundAgentCount counts only Claude-Code backgroundTask rows, so bb cannot even show that an ACP agent has work in flight.

This tracks the bb side: capability handshake, notification routing, synthetic resume, and background-task materialization. It is the delivery half of #2122 (which tracks rendering of unprompted session/update frames): on OMP 18.x there are no frames to render — verified live in production below. Work shipped to git while the thread sat idle forever.

2. Versions and environment

3. Steps to reproduce

  1. Start a thread on acp-omp and give the agent work that ends the turn with background agents still running (OMP's "ending the turn for auto-delivery" — its core resume mechanism).
  2. Wait minutes for the agents to settle.
  3. OMP resumes the orchestrator detached inside its own process; the follow-up turn runs to completion (verification gate, commit, final summary).
  4. The bb thread never reacts: no turn, no message, no error; idle forever.

4. Expected vs actual

Observed live (all UTC, 2026-08-26):

00:50:37    turn/completed — orchestrator ends turn, 2 background agents in flight
01:01–01:04 agents finalize inside OMP
01:05:32–53 OMP's detached resume completes: verification gate passes,
            commit 75e0691 lands 01:05:34 (14 files, +793/−149),
            close-out summary written to the OMP session transcript only
bb events:  zero turn events; one acp/fs/write at 01:05:32 surfaced as a
            hidden provider/unhandled row; no session/update of any kind

Expected: the thread reports the follow-up (summary + commit), or at minimum a resumable state. Actual: complete silence — the work exists only in git and ~/.omp/agent/sessions/, and the user has to learn it shipped from elsewhere.

5. Evidence

Each side of the gap, at d3f7a90:

  • Routing: handleAgentNotification in packages/provider-bridge-acp/src/bridge/bridge.ts (L2504–L2511) returns immediately for any method !== "session/update" — everything else an agent sends is dropped without logging.
  • Turn initiation: packages/domain/src/thread-events.ts types client/turn/requested with source: z.enum(["spawn", "tell"]) (L119) — no producer can express an agent-initiated request, even though initiator already includes "agent" (invariant comment at L121) and continuationOfRequestId exists unused (L117–118). The event surface is half-ready.
  • Visibility: activeBackgroundAgentCount is SQL over backgroundTask rows that ACP providers never write — bb cannot show "N agents running" for OMP.
  • Send path: the provider-retry plumbing (continueCandidate, plugins/provider-retry/src/service.ts L505) already sends agent-only continuations with a legible decline (input-not-accepted when the session can't accept) — the same shape a wake-answer needs.
  • Agent side: ACP: async-job auto-delivery turns reach clients unbracketed; allowAgentInitiatedTurns never enabled can1357/oh-my-pi#9157 option (b) — agentCapabilities._meta["oh-my-pi"].agentWake / clientCapabilities._meta["bb.dev"].agentWake handshake, PromptResponse._meta.pendingAsyncJobs, an _-prefixed wake notification, and delivery parked on the existing hidden-message queue until the client prompts.

6. What I ruled out

7. Suggested priority and effort

Same population as #2122 — every acp-omp thread whose turn ends with background work — now with guaranteed rather than heuristic loss. P1; medium effort, additive and fully gated so nothing changes for agents that don't advertise:

  1. Advertise clientCapabilities._meta["bb.dev"] = { agentWake: 1 } at initialize; treat agentCapabilities._meta["oh-my-pi"].agentWake as the agent-side opt-in.
  2. Route _-prefixed notifications through handleAgentNotification instead of dropping them.
  3. On wake: synthetic resume on the existing send path, emitting client/turn/requested with initiator: "agent" and continuationOfRequestId (extend the source enum with a "wake" member or equivalent); decline legibly (input-not-accepted) if the session can't accept.
  4. Materialize backgroundTask rows for ACP agents with work in flight so activeBackgroundAgentCount and the UI count them.
  5. Keep the hardening from the Bracket agent-initiated ACP turns so unprompted work renders #2220 review: a wake racing a user prompt can hit omp's Agent is already processing rejection — queue-and-retry with backoff rather than failing the synthetic turn.

Sequencing: lands after (or with) the OMP-side capability.

Activity

  1. added
    providers
    provider-acp
    omp
    on Aug 26, 2026
  2. bradhallett commented on Aug 27, 2026

    @bradhallett
    ContributorAuthor

    Upstream status update (2026-08-27):

    • The busy-detection half of the detect → wait → resume composition landed and shipped: fix(acp): surface session-busy as a typed JSON-RPC error instead of -32603 can1357/oh-my-pi#9825 (merged by can1357) is in omp v18.0.8. session/prompt racing an in-flight turn now returns a typed error:

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

      Settled consumption contract for the resume path: branch on data.reason === "session_busy" only (hint is display text), treat as transient, retry once idle. Note bb already surfaces the message text today via data.details extraction, so this needs no interim fix — it becomes load-bearing when the synthetic resume lands.

    • Remaining blocker: the wake notification itself — decision pending in ACP: async-job auto-delivery turns reach clients unbracketed; allowAgentInitiatedTurns never enabled can1357/oh-my-pi#9157 (option (b) capability + _-prefixed notification + parked delivery). No code exists upstream yet; three ACP consumers (bb, Tx Code, Sesori) are waiting on it.

  3. bradhallett commented on Sep 3, 2026

    @bradhallett
    ContributorAuthor

    Line item 1 (consume the settled session_busy contract: queue the prompt, retry once on idle) is up as #3004. It's independently useful regardless of which idle-side design lands in can1357/oh-my-pi#9157, so I split it out rather than holding it behind that decision.

    The wake-consumption half of this issue stays gated on #9157: _omp/session/wake routing, synthetic resume, and backgroundTask rows all depend on omp actually emitting the wake notification.

  4. Tabulanga commented on Nov 6, 2026

    @Tabulanga

    Reproduced on bb 0.48.1 / OMP 18.17.0, using openai-codex/gpt-6.1-sol.

    Steps:

    1. The parent launches a native OMP subagent that takes about 45 seconds.
    2. The parent ends its turn before the child finishes.
    3. No further prompts or wake callbacks are sent.

    The child finishes, and OMP automatically resumes the parent: both the child’s final answer and the parent’s continuation are present in OMP’s native transcripts.

    However, a transparent ACP stdio recorder captured no messages after the initial session/prompt response, including 106 seconds after the parent’s native continuation. bb therefore shows no continuation.

    This was tested in a disposable bb instance without source modifications. The same symptom occurred without the recorder.

    Is #2461 the correct tracker? Is there an existing capability/configuration for delivering this continuation, or does it require changes on the OMP and/or bb side?

    AGENT GENERATED; verified against captured ACP traffic and native transcripts.

  5. DiscipulusVitae commented on Nov 15, 2026

    @DiscipulusVitae

    Cross-provider evidence from agy 1.5.9 / Linux arm64 under BB 0.49.0, demonstrating that the need for a generic agent-wake / synthetic-resume mechanism extends beyond OMP.

    We documented and independently reproduced this behavior in google-antigravity/antigravity-cli#1461 (comment):

    1. Background turn lifecycle mismatch: When an agent launches asynchronous background work (e.g. under an autonomous /goal), the first ACP turn settles with {"stopReason": "end_turn"}.
    2. Silent idle interval: When the background task settles, Antigravity records the reactive wake-up, subsequent tool calls, and final response in its native transcript. However, during that idle interval, ACP stdout produces 0 bytes (no session/update frames reach the client).
    3. Interactive elicitation deadlock: If the reactive continuation invokes an interactive step (ask_question / elicitation), the request is held internally without delivery while the connection is idle. Empty prompts are rejected with -32602 Empty prompt, so the client cannot passively poll for pending interactions.
    4. Resumption requires synthetic user traffic: Only when a new user prompt is submitted does Antigravity flush the queued stream and surface the held updates/elicitations.

    This shows that the lifecycle gap where background work settles outside an active client turn is not unique to OMP. A provider-neutral wake capability handshake and synthetic resume path in provider-acp would provide a robust, unified consumption model for both OMP and Antigravity runtimes.

    AGENT GENERATED; user-approved; verified against captured ACP traffic and native transcripts.

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

    ompprovider-acpproviders

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions