fix(server): fail V2 turns when the OpenCode event stream ends - #9905
fix(server): fail V2 turns when the OpenCode event stream ends#9905saphid wants to merge 387 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped OpenCode V2 error-handling fix that cleanly terminates active turns and blocks stale work after event-stream EOF. The production change is isolated to the adapter and is covered by deterministic tests for clean termination and race conditions. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ed8886d. Configure here.
b82facd to
2ac9bfe
Compare
9f4f5e0 to
8d4d71b
Compare
There was a problem hiding this comment.
All clear
Posted via Macroscope — Effect Service Conventions
9242b91 to
3d81172
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
- Re-route steering that races completion into idempotent follow-up dispatches - Preserve scheduled-task attribution and provider ownership history across clients
Port main's pull-request discovery, active thread ordering, async question dismissal, settlement fixes, provider-session import, attachment context, and provider correctness changes into orchestration v2. Keep the branch's intentional composer and subagent behavior while adopting main's web and mobile fixes. Prevent headless setup terminals from hanging on the color probe, and move the v2 migration block to 050-061 after main claimed 048-049.
Restore the failed-before-start timer guard, align two server fixtures with the reconciled behavior, and remove dead files, exports, and dependencies surfaced by Knip. Drop the temporary branch push trigger now that the PR is mergeable, so each update runs the pull-request workflow once.
Keep main's batch machine-update banner and update action while preserving the v2 runtime-based environment lock used by draft load balancing.
Adopt TypeScript 7 and Effect rc.112 across orchestration v2, including the TaggedError API migration and updated Effect-aware tests. Restore main's composer-aware scroll-to-end clearance while retaining selected-model settings sync, preview recording transfer, image galleries, desktop context menus, and layout hit targets. Regenerate the lockfile on the upgraded dependency baseline.
efd9994 to
6102d00
Compare
Advertise bounded socket snapshots and authoritative dispatch validation, omit raw command output and inline file bodies at the wire boundary, and preserve compact status metadata across web and mobile. Add transport-budget coverage for snapshots, resume, commands, legacy import, and projection maintenance.
f134f08 to
02f7c19
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Dismissing prior approval to re-evaluate 02f7c19
There was a problem hiding this comment.
All clear
Posted via Macroscope — Effect Service Conventions
|
All clear Posted via Macroscope — Effect Service Conventions |
8187b17 to
ada72ce
Compare

An OpenCode event stream ending cleanly could leave its active turn running forever. Treat unexpected EOF as a transport failure, finish active turns, retire the runtime, and reject turns racing shutdown.
Rebuilt on current V2
7dd9873edwith the test-only prerequisite #10865 (merge that first). Current head1b789282c; the feature remains two files.Validation: 59 focused adapter and persistence tests pass, plus server typecheck, targeted lint and formatting. A follow-up regression reproduces a compaction response racing EOF: it fails on the previous code, while all 25 adapter tests now pass with termination owning the failure classification. Server typecheck and targeted lint/formatting pass again. New CI is pending. Cross-provider review was unavailable: the direct Claude Opus 5 high launcher exited 1 with expired OAuth before inference; no Claude review occurred.
Targets V2 #2829. Updated with GPT-6 in Codex/T3.