GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ACP: auto-resumed parent turn after a background subagent has no start or end marker · Issue #63855 · anomalyco/opencode

ACP: auto-resumed parent turn after a background subagent has no start or end marker #63855

New issue
Copy link
New issue
Copy link
Open
Open
ACP: auto-resumed parent turn after a background subagent has no start or end marker#63855
Copy link
Labels
area/ide-acpEditor integrations and ACPplatform/linuxLinuxtype/featureNew behaviour or an improvementversion/v2OpenCode 2.x

Description

@TennyZhuang
TennyZhuang
opened on Nov 13, 2026
Issue body actions

Summary

Follow-up to #55760. On v2.3.0 the parent's auto-resumed turn after a background subagent completes now reaches ACP clients (thanks), but nothing tells the client when that turn ends, or that it started. A client that tracks turn state has to show the session as busy until the next prompt it sends itself settles.

What the wire shows (v2.3.0, Linux x64, mock provider)

  1. Parent prompt starts a subagent (background). session/prompt returns end_turn (~1695 ms).
  2. With clientCapabilities._meta["opencode/child-session-updates"]: true, the client receives opencode/session/child_update for the child (created, running, its reply, completed at ~1707 ms).
  3. The parent auto-resumes server-side and its reply arrives as a root session/update agent_message_chunk (messageId: "message-5", ~1766 ms).
  4. Then nothing for the remaining 60 s: no usage_update, no session_info_update, no extension notification. Same without the capability (the chunk arrives at ~1948 ms, message-4).

Where it comes from (a6b15d3)

  • packages/cli/src/acp/turn.ts: after the prompt answers, handoff starts the background follower (followChildren), which forwards only what translate.ts produces.
  • packages/cli/src/acp/translate.ts rootEvent returns outputs: [] for session.execution.succeeded, interrupted and failed, so the resumed turn's end never reaches ACP; its start produces no output either.
  • sendUsageUpdate runs only when a prompt settles.

Request

Emit an explicit start and end for turns the server runs without a client prompt, for example a session_info_update (or an opencode/... extension notification) carrying the execution outcome (succeeded / interrupted / failed) and, if possible, the usage for that turn. Gating it behind a client capability, like opencode/child-session-updates, would be fine.

Why it matters

ACP has no StopReason for turns the client did not start, so without a marker clients either leave the session "running" indefinitely or guess with a timeout. We maintain an ACP client library (botiverse/oar) that maps OpenCode's background subagents through child_update and documents this as a known gap; the recorded frames and a reproduction script are in https://github.com/botiverse/oar/tree/main/experiments/opencode-child-background .

Activity

  1. opencodejr commented on Nov 13, 2026

    @opencodejr
    opencodejrBot
    on Nov 13, 2026
    Contributor
    More actions

    Thanks for the detailed follow-up and the recorded frames.

    As I understand it, you're asking the ACP adapter to send an explicit start and end for turns the server runs without a client prompt. A typical case is the parent turn that auto-resumes after a background subagent reports. The end would carry the execution outcome (succeeded / interrupted / failed) and, ideally, the turn's usage, and it could be gated behind a client capability.

    I checked this against the current code and it matches what you describe:

    • In packages/cli/src/acp/translate.ts, rootEvent returns no outputs for the parent's session.execution.succeeded / interrupted / failed events.
    • In turn.ts, sendUsageUpdate is only called when a prompt the client sent settles.

    The resumed turn's content now arrives, as the fix for #55760 (#63395) intended. Nothing marks the turn's boundaries, though, and ACP has no stop reason for a turn the client didn't start. So I'm treating this as a feature request for a new notification rather than a bug. Maintainers will consider it.

    Related issues:

    • ACP: parent's auto-resumed turn after background subagent completion emits zero session/update (dropped by background turn) #55760 / fix(acp): stream the parent's reaction to background subagent reports #63395: the earlier gap where the resumed turn's content was dropped (now fixed)
    • feat(core): always run subagents in the background #63210: makes every subagent run in the background, so more ACP clients will run into this
    • [Bug]: ACP session/prompt resolves end_turn before the turn completes; session/update notifications continue after the response #63096, session/update notifications sent after session/prompt response (end_turn) #17505: updates arriving after end_turn for a prompt the client did send (a different boundary)
    • [FEATURE]: SDK invocation accounting boundary for background-shell continuations #59953: a similar request for a usage boundary on background continuations, but in the SDK
  2. opencodejr
    added
    area/ide-acpEditor integrations and ACP
    platform/linuxLinux
    type/featureNew behaviour or an improvement
    version/v2OpenCode 2.x
    on Nov 13, 2026
  3. stamp-build
    added 2 commits that reference this issue on Nov 13, 2026

    docs(opencode): pin the 2.3.0 parent's unended own reply as a known s…

    00309db

    chore: release v0.104.0 (#778)

    8f83764
  4. ammarg-cloud commented on Nov 25, 2026

    @ammarg-cloud
    ammarg-cloud
    on Nov 25, 2026
    More actions

    Additional data point on v2.4.1: beyond the missing start/end markers on an auto-resumed parent turn, chaining a second wave of background subagents from inside an auto-resumed turn drops the subsequent parent turn from ACP completely.

    Observed trace (opencode acp, v2.4.1):

    1. Client sends session/prompt; parent spawns 2 background subagents and returns stopReason: "end_turn".
    2. Subagents finish → first auto-resumed parent turn does stream over ACP, and spawns 2 more background subagents.
    3. Second wave of subagents finishes ~17s later; the parent auto-resumes, completes edits, and writes the final reply to opencode.db (visible via session/load and session/list updatedAt), but nothing is sent over ACP (0 unread bytes on stdout).

    Looking at the ACP background loop, once session.execution.succeeded hits w.terminal && !hasOpenBackground(state) (or resets started = false with start: undefined), the background event subscription appears to tear down or stop forwarding before a chained second auto-resume completes. An explicit start/end boundary for server-initiated turns (plus keeping the subscription alive across chained background waves) would close both gaps.

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

    area/ide-acpEditor integrations and ACPplatform/linuxLinuxtype/featureNew behaviour or an improvementversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.