Skip to content

Workers Builds auto-deploy + fix dodo-verify SSE flake#51

Closed
jonnyparris wants to merge 2 commits intomainfrom
docs/workers-builds-re-enabled
Closed

Workers Builds auto-deploy + fix dodo-verify SSE flake#51
jonnyparris wants to merge 2 commits intomainfrom
docs/workers-builds-re-enabled

Conversation

@jonnyparris
Copy link
Copy Markdown
Owner

@jonnyparris jonnyparris commented Apr 25, 2026

Summary

Two changes:

  1. Workers Builds re-enabled for dodo with a single Deploy default branch trigger on main running npm run build && npx wrangler deploy. The non-production preview trigger that was failing on every PR push has been deleted via API (it ran wrangler versions upload, which is the only command that hits the experimental flag block, code 10021). README + AGENTS.md updated to reflect that auto-deploy is live; wrangler deploy doesn't reject experimental flags, only versions upload does.

  2. Fix SSE TransformStream unhandled rejection that was flaking dodo-verify.yml on roughly half of CI runs. Two handlers (UserControl.openUserEventStream and CodingAgent.openEventStream) did fire-and-forget writes without .catch(). When a client disconnected mid-write, the rejection surfaced as an unhandled rejection and vitest failed the run despite all 642 tests passing. Also fixed try/catch around void writer.close() — that pattern only catches sync throws but close() returns a promise, so switched to .catch().

The flake fix was carried on this PR because it was blocking the docs from merging. Closes the operational fallout from #46.

Test plan

  • After merge, push to main should trigger the Deploy default branch build and deploy successfully.
  • PR pushes no longer trigger Workers Builds (no preview trigger), so they only get the dodo-verify.yml typecheck/test signal — which should now be reliably green.
  • Ran tests 3x locally after the SSE fix — all clean (642/642, 0 unhandled rejections each time).

beep-boop-🤖

The 'experimental' compat flag is fine for wrangler deploy — only
wrangler versions upload rejects it (code 10021). Re-enabled Workers
Builds with a single 'Deploy default branch' trigger on main running
'npm run build && npx wrangler deploy'. The non-production preview
trigger that was failing on every PR push has been deleted (it ran
versions upload, which is the only command that hits the experimental
flag block).

PR validation continues to run via .github/workflows/dodo-verify.yml
(typecheck + test). Manual deploy still works.
@jonnyparris jonnyparris marked this pull request as ready for review April 25, 2026 20:00
Two TransformStream-based SSE handlers (UserControl.openUserEventStream
and CodingAgent.openEventStream) were doing fire-and-forget writes
without .catch() handlers. When a client disconnected before the first
write resolved, the readable side tore down and writer.write() rejected
with 'The readable side of this TransformStream is no longer readable'.
With no handler attached, vitest treated it as an unhandled rejection
and failed the run despite all 642 tests passing.

Also fixed the close() teardowns: 'try { void writer.close(); } catch'
only catches synchronous throws, but close() returns a promise that can
reject async. Switched to .catch().

Verified: 3 consecutive clean runs in the worktree after the fix.
Previously the flake hit roughly 50% of CI runs.

Carrying this on the docs PR because it's blocking that PR's merge.
@jonnyparris jonnyparris changed the title docs: workers builds auto-deploy on push to main is live Workers Builds auto-deploy + fix dodo-verify SSE flake Apr 25, 2026
@jonnyparris jonnyparris deleted the docs/workers-builds-re-enabled branch April 25, 2026 21:26
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