You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal-mode round driver (SessionPrompt.loop) re-claims unconditionally on every normal ensureRunning return, but that return is normal for three different outcomes: the single-flight Runner converts user cancel into its registered onInterrupt value for joiners (so the loop's onInterrupt(pauseOnCancel) never fires), and the processor converts provider failures into error-bearing "stop" results. Net: deterministic provider errors hot-retry burning the round budget, the stop button does not stop the loop, and quit/crash between admit-and-run leaves orphan synthetic goal_round messages with rounds spent.
Reproduction
Run a goal-mode session against a stubbed HTTP 400 provider error (or press stop / quit mid-round)
Observe: the loop re-runs the round instead of pausing (errors), cancel does not pause, quit leaves trailing unexecuted synthetic goal_round messages
Expected: cancel pauses at once; dead rounds pause after 3 consecutive (2 when non-retryable); no orphan rounds after quit
Environment
opencode v1.18.29 source build + a local goal-mode extension (same-session round driver + /goal command, cf. [extend] Goal mode: same-session autonomous long-horizon loop #48240) on Linux. The re-claim mechanics (Runner cancel conversion, error-to-stop conversion) live in upstream session core (packages/opencode/src/session/), so the underlying hazard likely affects any driver built on SessionPrompt.loop.
Suggested fix
A GoalDriver.assessRound classifier per round from the last assistant message (productive / cancelled via MessageAbortedError / dead with APIError.isRetryable); a reconcile() retracting trailing unexecuted synthetic rounds via removeMessage + CAS. Fault-injection regression test included in the local patch; available on request.
No issue template was used. Please use one of the three templates: Bug Report, Feature Request, or Question
Bug reports should include reproduction context: environment info (OS, version), steps to reproduce, and observed vs expected behavior — this issue describes the root cause analysis well, but lacks that structure
The title prefix [fix] does not match any of the required templates (Bug Report titles have no required prefix; Feature Requests should start with [FEATURE]:)
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of or closely related to existing issues. Please check:
Body reshaped to the Bug Report template and title de-prefixed per the compliance check. Environment now discloses the local goal-mode extension explicitly.
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
Activity
github-actions commentedon Sep 9, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[fix]does not match any of the required templates (Bug Report titles have no required prefix; Feature Requests should start with[FEATURE]:)Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of or closely related to existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
[-][fix] Goal-mode round driver re-claims blindly after errors/cancel; quit leaves orphan rounds[/-][+]Goal-mode round driver re-claims blindly after errors/cancel; quit leaves orphan rounds[/+]johnhenry030888 commentedon Sep 9, 2026
Body reshaped to the Bug Report template and title de-prefixed per the compliance check. Environment now discloses the local goal-mode extension explicitly.
github-actions commentedon Sep 9, 2026
Thanks for updating the issue — it now includes a clear description, reproduction steps, and environment details. Everything looks good!
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊