Skip to content

/goal does not see courier children: a root waiting on reports is pushed on #421

Open

Description

@ivopogace

The problem

OpenCode's built-in /goal (anomalyco/opencode#59437, since 2.2.4; packages/core/src/plugin/goal.ts) runs a judge on the experimental.idle hook each time the session would go idle. It holds back only for the host's own background work in event.background: the session's subagents, image jobs and shells. Courier children are not in that list, and a plugin cannot add to it.

So a root with an active goal that spawns courier children and ends its turn to wait for their reports looks finished to the judge. It answers continue and the root is prompted on instead of waiting (it may poll, redo the children's work, or spawn again); after three rounds with no progress the goal pauses ("Not making progress"). wait is offered only while a shell runs, so the judge cannot even choose it.

What you'd like

  1. Upstream: ask anomalyco/opencode for a way for a plugin to declare background work for a session in SessionIdle.background (or for /goal to skip judging while plugins report pending work). Draft for the upstream issue:

    /goal's idle judge only sees host background work (subagent, image, shell). Plugins that run work in other sessions and wake the session when it finishes (opencode-courier spawns child sessions that report back with a synthetic message) have no way to say so, so the judge reads a session waiting on them as done or stalled and prompts it on. Could the plugin API let a plugin add entries to SessionIdle.background (say { kind: "plugin", sessionID, description }), or let /goal hold back while any plugin reports pending work for the session?

  2. Here, until then: say in docs/reference.md that /goal on a session with courier children out does not wait for their reports. Check whether the courier's own experimental.idle hook (see the nudge issue) can help at all; it cannot change /goal's verdict, since the host builds background.

Repro to confirm before documenting: a root with /goal <objective> that spawns a child and ends its turn; watch for /goal's continuation message before the child reports.

Alternatives

Tell users not to combine /goal with courier children.

Activity

  1. self-assigned this
    on Oct 31, 2026
  2. ivopogace commented on Oct 31, 2026

    @ivopogace
    OwnerAuthor

    The local half is done in #425: a live repro on 2.2.4 confirmed the issue, and the docs now explain it and what to do instead.

    The upstream request is filed as anomalyco/opencode#60860. This issue stays open until OpenCode answers it.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions