Skip to content

runtime: Bun 1.4 preview-dev product candidate stack #1691

Description

@lidge-jun

Area

Multiple areas

What are you trying to accomplish?

Ship a production-ready Bun 1.4 candidate stack on preview-dev so that when Bun 1.4.0 reaches npm, the stable promotion is a single dependency bump — all compatibility patches, CI qualification, and memory/stream/worker improvements are already landed and verified.

What prevents this today?

  • Bun 1.4.0 canary is not yet published on npm (latest canary: 1.3.13-canary.20260425.1, latest stable: 1.3.14)
  • CI hardcoded bun-version: 1.3.14 in 11 places — resolved in c7c34f6 via composite action
  • preview-dev was not a CI-qualified branch — resolved in c7c34f6
  • Stream caps, Worker lifecycle, and fetch paths need runtime-gated Bun 1.4 optimizations

What should OpenCodex do?

When a Bun 1.4 canary becomes available on npm, implement the following commit train on preview-dev:

Commit train (blocked on upstream Bun 1.4 canary)

# Commit Status
1 ci(runtime): source Bun version from package.json and qualify preview-dev ✅ Done (c7c34f6)
2 chore(runtime): bundle Bun 1.4.0-canary.N on preview-dev ⏳ Blocked — no canary on npm
3 test(runtime): record bundled Bun version and revision across package smokes ⏳ Depends on #2
4 test(memory): add 1.3.14 versus 1.4 wave and quiescence harness ⏳ Depends on #2
5 perf(stream): enable eager relay for qualified Bun canary revisions ⏳ Depends on #2
6 perf(stream): use an exact byte queue and global relay budget ⏳ Depends on #5
7 fix(fetch): cancel unconsumed response bodies on retry and failure ⏳ Depends on #2
8 perf(worker): skip Bun 1.3.14 OS join settles on qualified Bun 1.4 ⏳ Depends on #2
9 test(runtime): prove Bun 1.4 isolate teardown without legacy job splits ⏳ Depends on #8
10 docs(release): document Bun 1.4 preview-dev promotion and rollback ⏳ Depends on all
D-day chore(runtime): promote bundled Bun from canary to 1.4.0 ⏳ After npm release

Example usage or interface

Stable-day promotion sequence:

preview-dev → dev → preview → main

Day-of changes limited to:

- "bun": "1.4.0-canary.N"
+ "bun": "1.4.0"
- MIN_FIXED_BUN_VERSION: null
+ MIN_FIXED_BUN_VERSION: "1.4.0"

Alternatives or workarounds

Wait for Bun 1.4.0 stable and scramble on release day — riskier because stream/worker/fetch patches would be untested on the new runtime.

Additional context

  • Roadmap docs: devlog/_plan/260814_bun14-preview-dev/ (000-100 decade docs with diff-level precision)
  • CI composite action already landed: .github/actions/setup-project-bun/action.yml
  • Branch: preview-dev (fast-forward from dev, now CI-qualified)
  • Key files to patch: src/lib/bun-stream-caps.ts, src/server/relay-eager.ts, src/storage/worker-lifecycle.ts, fetch error paths across src/oauth/, src/providers/, src/adapters/
  • Rollback devices to preserve until stable 1.4 first release: OPENCODEX_BUN_PATH, streamMode=legacy-tee, Worker settle fallback, split fresh-process CI jobs

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestroadmapAccepted long-term work item; needs its own project cycle

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions