Skip to content

Commit 84f36d2

Browse files
authored
fix(server): recover OpenCode turns when 1.14.42+ SSE drops early (#902)
OpenCode 1.14.42+ closes the /event SSE stream cleanly right after server.connected, breaking the entire turn lifecycle: prompts get queued and run, but Paseo never sees session.idle / message deltas / tool calls / questions. Every turn either fails with a generic stream EOF or hangs waiting for events that never arrive. Switch the post-EOF recovery to the canonical messages REST endpoint (via the upgraded SDK) and poll incrementally so tool calls and clarifying questions surface live during the SSE gap. Bound the wait with a completion cap and a separate liveness cap so silent rejections fail fast instead of hanging until the cap. Cap session.abort similarly so explicit cancels land within seconds. The recovery path is gated on the for-await loop exiting without a terminal event, so healthy turns never enter it - if upstream restores SSE delivery, this code becomes dead and is mechanically removable via the COMPAT(opencodeEofRecovery) and COMPAT(opencodeSlowAbort) tags. Also tighten the type of projectSettingsRoute on WorktreeSetupCalloutPolicy so router.navigate accepts it (was widened to string, broke app typecheck on main). Refs: #861, anomalyco/opencode#26697, anomalyco/opencode#26635
1 parent 25d4c50 commit 84f36d2

7 files changed

Lines changed: 1273 additions & 333 deletions

File tree

‎package-lock.json‎

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/app/src/components/worktree-setup-callout-policy.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface WorktreeSetupCalloutPolicy {
3030
title: string;
3131
description: string;
3232
actionLabel: string;
33-
projectSettingsRoute: string;
33+
projectSettingsRoute: ReturnType<typeof buildProjectSettingsRoute>;
3434
testID: string;
3535
}
3636

‎packages/server/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@mariozechner/pi-ai": "^0.70.2",
6666
"@mariozechner/pi-coding-agent": "^0.70.2",
6767
"@modelcontextprotocol/sdk": "^1.20.1",
68-
"@opencode-ai/sdk": "1.2.6",
68+
"@opencode-ai/sdk": "^1.14.46",
6969
"@sctg/sentencepiece-js": "^1.1.0",
7070
"@xterm/headless": "^6.0.0",
7171
"ai": "5.0.78",

0 commit comments

Comments
 (0)