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 — run --format json omits every subagent event (still in 2.x, see #49300) · Issue #62380 · anomalyco/opencode

run --format json omits every subagent event (still in 2.x, see #49300) #62380

New issue
Copy link
New issue
Copy link
Open
Open
run --format json omits every subagent event (still in 2.x, see #49300)#62380
Copy link

Description

@charlie-morrison
charlie-morrison
opened on Nov 6, 2026
Issue body actions

Description

opencode run --format json prints nothing a subagent does. Only events from the root session reach stdout: the subagent's shell calls, text and steps are dropped, and the root's subagent tool_use appears only once the subagent has finished. A headless consumer can't show progress, or see where a long subagent got stuck.

#49300 reported this against 1.18 and was closed for 2.0. It is still there in 2.2.1 and 2.2.3. packages/cli/src/run/noninteractive.ts skips every event whose sessionID isn't the root one (:236 at v2.2.1, :239 at v2.2.3), while ownsSession a few lines up already follows parentID so that subagent permission prompts are answered. On dev after #61911 the same check is at :172.

Plugins

none

OpenCode version

2.2.3 (same on 2.2.1)

Steps to reproduce

  1. Point the openai provider at a stub Responses endpoint (OPENCODE_CONFIG_CONTENT with baseURL) and run opencode run --standalone --format json --auto --model openai/gpt-test -- "go" with an empty HOME.
  2. The stub answers the root's first turn with a subagent call (agent: general). It answers the child's first turn with shell echo child-ran, and every turn that carries a tool result with plain text.
  3. The stub receives the child's requests, and the child's shell result (child-ran) comes back to it, so the subagent ran.
  4. stdout has only root-session lines: step_start, tool_use (subagent, whose metadata.sessionID names the child), step_finish, step_start, text, step_finish. Nothing from the child session.

Operating System

Linux Mint 22.3 (Ubuntu 24.04 base), x64

Terminal

none (headless)

Downstream: alpha-omega-security/scrutineer#1318, where an 8-hour run timed out inside a subagent with no trace of what it was doing.

Activity

  1. opencodejr commented on Nov 6, 2026

    @opencodejr
    opencodejrBot
    on Nov 6, 2026
    Contributor
    More actions

    Thanks for the detailed report and for tracing it to the code.

    This looks like a feature request rather than a regression. In v2, opencode run --format json only prints events from the root session, and that filter was kept on purpose when the noninteractive runner was rewritten in #61911. ownsSession follows parentID only so that subagent permission prompts get answered; it was never meant to include subagent output. So the request is: stream subagent (child-session) events in run --format json, marked with the session they come from, so headless consumers can show progress and see where a long subagent is stuck. Maintainers will consider it.

    For now, if you need live subagent activity, you can run a server and subscribe to its event stream through the SDK. That stream includes child-session events, and each child session links back to its parent through parentID.

    Related:

    • run --format json drops every subagent part: the loop tracks child sessions, honours them for permissions, and filters parts against the root session #49300: the same report against v1.18, closed as part of the v1 cleanup
    • [FEATURE] opencode run: expose child session events (subtask_event/subtask_delta) in NDJSON stream #33396 / [FEATURE] opencode run: expose child session events (subtask_event/subtask_delta) in NDJSON stream #33397: earlier requests to expose child-session events in the opencode run NDJSON stream
    • Subagent permission/error events leave external integrations no way to see root-session progress (pane misreported as blocked/needs-input while subagent runs) #46685: telling child-session events apart from root-session ones (closed v1 report)
  2. darienjournye26 commented on Nov 6, 2026

    @darienjournye26
    darienjournye26
    on Nov 6, 2026
    More actions

    If the intent of the sessionID filter in packages/cli/src/run/noninteractive.ts is to avoid event duplication for headless consumers, why is the parentID logic used for permission prompts not extended to stream child events into the JSON output?

  3. lalith0407 commented on Nov 15, 2026

    @lalith0407
    lalith0407
    on Nov 15, 2026
    More actions

    I'd like to work on this. Proposal:

    1. Behind an opt-in flag, also emit subagent events, tagged with their sessionID and parentID.
    2. At the end, emit one result event with total tokens and cost across all sessions, plus step count, duration and outcome.

    Existing output doesn't change. Does this direction work, and should I build on #60508? Happy to be assigned.

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

    No labels
    No labels

    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.