Skip to content

OpenCode 2: "Plannotator session ready" synthetic notice wakes a model turn despite resume: false #1459

Closed

Description

@Naasha

What happened?

Environment

  • Plannotator plugin: @plannotator/opencode@0.27.11 (installed 2026-09-02 via @latest)
  • Host: OpenCode 2, opencode2 --version → v0.0.0-beta-18866 (Linux)
  • OpenCode 1 (1.18.25) is also installed on the machine; the affected session ran under OpenCode 2
  • Flow: /plannotator-last → command.execute.before hook → embedded runtime (handleAnnotateLastCommand)

Summary

Since 0.27.10 (#1434 + #1435), the session URL notice posted into the transcript on OpenCode 2
(Plannotator session ready: <url>) wakes a model turn, even though it is injected with
resume: false. The agent starts reasoning about the notice text itself while the reviewer is
still annotating, and the feedback (delivered with delivery: "queue") then lands queued behind
that spurious turn
.

Steps to reproduce

  1. OpenCode 2 (v0.0.0-beta-18866) with @plannotator/opencode@0.27.11.
  2. In a session, run /plannotator-last. The annotation UI opens.
  3. Do not submit anything. Within seconds, the agent starts a model turn on the message
    Plannotator session ready: http://localhost:<port> — before the reviewer has clicked
    "Send feedback".
  4. Submit feedback: it arrives as a queued message behind the in-flight agent turn.

Reproduced twice in two independent sessions (different ports, 37893 and 32867).

Expected behavior

The notice renders in the transcript but never starts a model turn. That is the plugin's own
contract — native-commands.test.ts pins it:

Regression: without resume: false upstream calls execution.wake (packages/core/src/session/session.ts),
so merely showing a URL would start a model turn the reviewer never asked for and burn tokens
on every command.
— test "the notice never wakes a model turn"

createSessionUrlNotifier (v2-client.ts) does call
synthetic({ sessionID, text, description, resume: false }), so the send side looks correct.

Actual behavior

  • The synthetic notice is delivered to the model as a user-role prompt: the assistant received
    the literal text Plannotator session ready: http://localhost:32867 (byte-for-byte
    formatSessionUrlNotice(url)) and began a turn reasoning on it.
  • The user's submitted feedback (delivery: "queue", per FEEDBACK_DELIVERY) is then stuck
    behind that turn — the whole point of posting the notice silently is defeated.

Analysis

I checked the current v2 branch of anomalyco/opencode:

  • The guard plannotator relies on exists in
    packages/core/src/session/session.ts:

    if (input.resume !== false && !(yield* get(sessionID)).revert) yield* execution.wake(sessionID)
  • SessionInbox.admit() itself does not wake; only the explicit execution.wake calls do.
    So on the current v2 source, a resume: false synthetic should be silent. Two hypotheses for
    what breaks on beta-18866:

  1. The beta build predates that guard (I could not map beta-18866 to a public tag/ref to verify).
  2. The notice leaves delivery at the host default ("steer", per input.delivery ?? "steer" in
    synthetic()), and on this beta a steer-pending admission interacts with the execution loop
    (e.g. wake-on-idle for steers) independently of the resume guard. Feedback deliberately uses
    delivery: "queue"; the notice is the only synthetic that rides the default.
    Possible directions
  • Plugin-side: pass an explicit non-waking delivery (e.g. "queue") to the notice's
    synthetic() call, mirroring what feedback already does — cheap and host-version-proof.
  • Or feature/host-detect the beta and degrade to the old silent paths.
  • Possibly an upstream fix if the wake indeed comes from steer admission on this beta.

Plannotator version

0.27.11

OS

Linux

Agent

Other

Where did it happen?

Annotate

Activity

  1. backnotprop commented on Sep 2, 2026

    @backnotprop
    Owner

    Thanks for an unusually well-researched report. Triage results:

    One correction to the flow you named: on OpenCode 2 the plugin's command.execute.before hook and handleAnnotateLastCommand never run; that is the OpenCode 1 entry. OpenCode 2 loads the V2 adapter (dist/server.js), where /plannotator-last runs as a native command through the CLI bridge, and the URL notice reaches the transcript through createSessionUrlNotifier in v2-client.ts. The literal text you saw is produced only there, which confirms that path ran. It does pass resume: false, and the pinned test drives that exact chain, so this is not a case of the test pinning one injection site while the bug rides another.

    We verified the upstream guard against anomalyco/opencode origin/v2 as of 2026-08-30: the resume check is present, and nothing on that snapshot wakes an idle session after a resume: false synthetic is admitted. Our checkout predates your beta-18866 build, so a change between Aug 30 and the beta cut cannot be ruled out. Your hypothesis 2 matches the mechanics we see: resume: false only skips the immediate wake, and the notice previously sat in the inbox at the host default delivery (steer), where any later wake promotes it first. Something on that beta wakes the idle session; the steer row then becomes its own model turn.

    Mitigation is up as #1460: the notice now passes an explicit delivery: "queue", mirroring what feedback already does, pinned in both wake tests. Queue rows never ride steer-scoped promotion, so the notice renders and waits for a genuinely user-initiated turn; no behavior change on hosts where the guard works. It will ship in the next release. If you still reproduce after that, the wake on your beta is input-scoped and the remaining fix is upstream; we plan to file an issue with the OpenCode project either way, since their own resume: false synthetics would burn a turn under the same conditions.

    Two things that would help:

    1. Does the same spurious turn happen after plan review (submit_plan) on the same beta? It uses the same notifier.
    2. Can you confirm it does not reproduce on OpenCode 1.18.x? That path uses a toast, not a synthetic, so we expect no.

    Also useful if you have it: any way to map beta-18866 to an upstream commit or build date.

  2. backnotprop commented on Sep 2, 2026

    @backnotprop
    Owner

    The mitigation is merged (#1460) and will ship in the next release. After updating, if the spurious turn still reproduces on your beta, reopen this and we will take the remaining half upstream with the evidence from your answers to the two questions above.

  3. Naasha commented on Sep 3, 2026

    @Naasha
    Author

    Hello,

    I update both opencode2 and plannotator to the latest version and the problem is still there.
    The only change is that now the behaviour is the following:

    • Opencode2 produces questions I want to annotate (i use grill-me skill btw)
    • I run the "/plannotator-last" command
    • The text "◈Plannotator session ready: http://localhost:39641" is written to the agent but the agent doesn't seems to wake up. My web browser opens correctly
    • I make my annotations and then "send feedback"
    • Now the agent is wake up but handles the "◈Plannotator session ready: http://localhost:39641" message and my annotations get queued while the agent is "thinking" about "The user says a Plannotator session is ready at a URL. This relates to the plannotator skills ...."

    Info:
    opencode2 v0.0.0-beta-18999
    plannotator 0.27.12

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions