What this thread does
Do first: Upgrade the OpenCode ACP provider to v2.4.1 for turn completion that awaits turn events.
Symptom
hancengiz reported OpenCode 1.2.21 as an ACP provider sending session/update notifications after the session/prompt response with end_turn. The client finalized incomplete or empty content and remained in a thinking state. This is a symptom, not a standalone error string. Other users commented on the issue: uwseoul, systemfreund.
Cause
The prompt HTTP response could finish while the ACP event stream was still draining. The merged PR waits for the backing session idle event before completing the ACP prompt response, after sequentially awaiting earlier updates.
Fix
1. Upgrade the OpenCode ACP provider to stable v2.4.1; the first carrying release was v1.18.14. 2. The original change registers the idle waiter before prompt, command, or summarize requests, and fails pending turns if the event stream disconnects. 3. In v2.4.1, turn handling has moved to packages/cli/src/acp/turn.ts: event outputs are awaited, ordinary prompt execution joins the event consumer, and the response is settled afterward. This supports the upgrade advice without assuming the old file layout still applies. See the merged change and source at v2.4.1.
Fixed in
Fixed in v1.18.14 (released 2026-08-05). PR #40422 merged 2026-08-04. The release comparison places the merge commit behind the release tag.
If it still fails
- The original fix fails pending turns on a disconnected event stream rather than returning an incorrectly ordered response. In v2.4.1, children and background shells can outlive a cancelled turn and use a separate background handoff. This is not a promise that every later background notification belongs before the completed foreground response.
Not for: TUI Preparing write stalls; see opencode-stuck-preparing-write-output-token-limit.
Sources
- session/update notifications sent after session/prompt response (end_turn), hancengiz, opened 2026-03-14; closed as completed on 2026-08-04: "The persisted message has empty content in the database".
- fix(acp): drain updates before end turn, nexxeln, merged 2026-08-04.
- Comment by uwseoul, 2026-03-15; parent issue closed as completed 2026-08-04.
- Comment by systemfreund, 2026-03-22; parent issue closed as completed 2026-08-04.
- v1.18.14, 2026-08-05 (stable).
- v2.4.1, 2026-11-23 (stable).
- Fix commit versus release tag, comparison read 2026-11-24.
- Source at v2.4.1: packages/cli/src/acp/turn.ts, read 2026-11-24.
Checked
2026-11-24; read the issue and linked comments, PR record, release records, release comparison, and the linked v2.4.1 source; no command was run.
Started from a post by @hancengiz, packaged by the editor. Original post