Skip to content

Read OpenCode's composer for GOA, and stop stall lines piling up - #54

Merged
enowdev merged 2 commits into
mainfrom
fix/issue-51-opencode-goa
Nov 10, 2026
Merged

enowdev merged 2 commits into
mainfrom
fix/issue-51-opencode-goa

Conversation

@enowdev

@enowdev enowdev commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Fixes points 1 and 2 of #51.

1. OpenCode as GOD of Agents never got worker reports typed in. OpenCode has no hook to wake GOA, so a line for it goes in only once its composer reads empty (goaCanType → agent.PromptEmpty). OpenCode's composer is a box of ┃ rows with no prompt mark, which no pattern matched, so reports waited in goa-tell.json. core/agent/prompts_opencode.go now reads that box as empty only when:

  • every row is bare or OpenCode's own placeholder (Ask anything… "…");
  • its last row is OpenCode's agent and model row (┃ Build · …) or its ctrl+p commands hint;
  • nothing is at work (esc interrupt), no permission prompt shows, and no dialog is open over it (an update's dialog was caught in the capture).

A row with anything else is a draft. A box of bars that isn't OpenCode's doesn't count for any agent. Tests use screens captured from OpenCode 1.18.35 on Linux through enowX's own terminal (empty, draft, dialog open) and the Windows rows quoted in the issue.

2. The stall watchdog flooded goa-tell.json. daemon/goa_stall.go:

  • A task whose session reported since its screen last moved is no longer flagged as stalled. The same goes for one whose report or turn's end is waiting for GOA.
  • No further stall line comes for a task while the one before is still waiting.

A report from before the screen last moved doesn't count, so a later turn that stalls is still reported. TestStallLinesDontPileUp fails without the change.

Point 3 (OpenCode's database size, and which tools workers get) is a separate decision. Point 4 (cloud presence) was already covered: the call has a 20 s timeout, and the long time was the machine sleeping.

Tested: go test ./core/agent/... ./daemon/... and go vet pass (also GOOS=windows go vet). Not run by hand: OpenCode on Windows. Its case is built from the issue's quoted rows, one of which was shortened with "...". OpenCode inside a conversation wasn't captured either: there was no AI provider on the test host.

🤖 Generated with Claude Code

enowdev and others added 2 commits November 10, 2026 08:05
OpenCode has no hook to wake GOA, so a line for it is typed in only once
its composer reads empty. OpenCode's composer is a box of bar rows with no
prompt mark, which no pattern matched, so worker reports waited in
goa-tell.json for good (#51). Its box now reads as empty when its rows are
bare or its placeholder and its last row is its agent and model or its
commands' hint, with no dialog open over it; a row with anything else is a
draft. Screens are from OpenCode 1.18.35 on Linux, and the Windows rows
the issue shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: enowdev <enowdev@gmail.com>
The stall watchdog told GOA of a task every three limits for as long as it
stayed still, and didn't look at whether its session had reported. With
OpenCode as GOA, whose lines never went in, a task that had reported done
filled goa-tell.json with its stall lines, pushing real reports out (#51).
A task whose session reported since it last moved, or whose report or
turn's end waits for GOA, is no longer stalled, and no further stall line
comes while the one before still waits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: enowdev <enowdev@gmail.com>
@enowdev
enowdev merged commit 81c8f80 into main Nov 10, 2026
4 checks passed
@enowdev
enowdev deleted the fix/issue-51-opencode-goa branch November 10, 2026 20:02
@enowdev enowdev mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant