Skip to content

fix(runtime): ship Bun 1.4.2 and keep the CI test runner on 1.4.0 - #6713

Merged
lidge-jun merged 6 commits into
devfrom
codex/bun-1.4.2-windows-streaming
Oct 8, 2026
Merged

lidge-jun merged 6 commits into
devfrom
codex/bun-1.4.2-windows-streaming

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Windows Bun 1.4.0 can close a local cleartext upstream socket after the first streamed response-body chunk ([Bug][Windows] Pinned transport kills the upstream socket after the first response-body chunk — local cleartext providers can never stream (502 upstream_server_error) #6684). Bun 1.4.1+ fixes it, so the shipped runtime moves to exact Bun 1.4.2: package.json dependencies.bun (the npm runtime), bun.lock (only bun and its 12 @oven/bun-* platform packages), and the Docker image pinned by multi-platform index digest sha256:9114c058aeae42162ee16dd5084b95fe9473970bb6bcb5b232ab1630f0546895. Provider routing and transport code are unchanged. Closes [Bug][Windows] Pinned transport kills the upstream socket after the first response-body chunk — local cleartext providers can never stream (502 upstream_server_error) #6684.
  • The CI test runner stays on Bun 1.4.0. Bun 1.4.2 segfaults (Segmentation fault at address 0x10) while re-loading the bunfig preload under multi-file bun test --isolate; that is why fix(ci,runtime): stop hiding the Bun runtime crash and pin back to 1.4.0 #4821 reverted wp6: pin Bun 1.4.2 and catch up the drifted workflow #4064, and this PR's earlier exact-head run 37631558263 reproduced it on Linux 1/4, macOS 2/2 and Windows 9/9 (single files pass).
  • New explicit pin package.json testRunnerBun: "1.4.0". .github/actions/setup-project-bun gains a role input: runtime (default, dependencies.bun) or test-runner (testRunnerBun); unknown roles and missing or malformed pins fail closed. The input is passed through env, never interpolated into the script.
  • Jobs that run multi-file bun test use role: test-runner: ci.yml test, storage-policy, api-usage, gates, platform-macos, macos-control, platform-windows, plus dev-version-bump open-bump-pr. Every job that compiles, packages, smokes or runs the shipped runtime stays on runtime (release.yml packaging/verify/publish, service-lifecycle, desktop-installed-gate, docker and keyring smoke, desktop-shell). The setup-action job now proves both roles install exactly what package.json declares.
  • The widget job had a stale direct bun-version: 1.3.14 pin (added in feat(macos): menu bar companion + widget, with CodexBar-style usage monitor integrated into Usage #5196 after the 1.4.0 pin). It compiles the desktop sidecar with prepare-sidecar.ts, so it now uses the runtime role to match what release.yml ships.
  • Why the versions differ and when to rejoin them is recorded in the action, the ci.yml test jobs, the Dockerfile header, install-scripts.test.ts, and structure/runtime.md: rejoin once the upstream runner crash is fixed and a green lane=all dispatch proves the unified version, then delete testRunnerBun and the role input.
  • Inside a package script, bun resolves to node_modules/.bin/bun, which is now the bundled 1.4.2. Without a fix, bun run test, bun run prepush and the local release helper's test preflight would run the suite on the crashing runner. New scripts/lib/test-runner-bun.ts picks the test runner. It uses the running executable when it already matches testRunnerBun. Otherwise it takes OCX_TEST_RUNNER_BUN (must report the pin) or a matching bun on PATH outside any node_modules or in ~/.bun/bin. If none matches, it fails with install guidance and downloads nothing. scripts/test.ts, scripts/test-layout/verify.ts, the scripts/release.ts preflight test commands (only those; audit, typecheck, privacy and version sync are unchanged) and scripts/openai-provider-option-final-gates.ts use it. CI is unaffected because its test jobs already run on the pin.
  • gui/package.json test (a probe showed its bare bun child resolved to the bundled 1.4.2) now runs through scripts/test-with-pinned-bun.ts. That wrapper preserves arguments, cwd and exit status, and forwards SIGINT, SIGTERM and SIGHUP to the child (exiting 130, 143 or 129). This is a package-script change only and has no UI change, so the maintainer applied gui-screenshot-waived. CI's cd gui && bun test --isolate tests is unchanged.
  • README (and its seven translations), CONTRIBUTING, and the English, French and Turkish contributing guides now say that package scripts may resolve the bundled Bun and that the suite needs Bun testRunnerBun. docs-bun-source-requirement.test.ts checks both versions against package.json.

Verification

  • bun run typecheck, bun run structure:check, git diff --check, bun install --frozen-lockfile --ignore-scripts all pass.
  • Each file separately with bun test --isolate on local Bun 1.4.0: tests/ci-workflows/install-scripts.test.ts (10 pass), tests/ci-workflows/ci-scope-gaps.test.ts (30 pass, includes the new role guard), tests/ci-workflows/ci-workflows.test.ts (142 pass), tests/ci-workflows/release-version-sources.test.ts (10 pass), tests/test-layout.test.ts (2 pass), tests/test-layout-tooling.test.ts (16 pass), tests/ci-workflows/file-size-ratchet.test.ts (9 pass). 0 fail.
  • Resolver: tests/ci-workflows/test-runner-bun.test.ts 12 pass (matching runtime, override match/mismatch, node_modules skip, ~/.bun/bin fallback, Windows bun.exe/quoted PATH, failure guidance). Existing test-runner and release-helper tests 98 pass / 3 skip. Real smoke with the bundled 1.4.2 installed: bun run test -- tests/ci-workflows/test-runner-bun.test.ts printed test runner: Bun 1.4.0 (~/.bun/bin/bun) and passed. bun run privacy:scan and the docs-site build pass.
  • Follow-up commits: docs-bun-source-requirement, test-runner-bun (GUI wrapper and signal-forwarding regression cases), test-layout-tooling (verify uses the pinned runner) and release-helper pass individually. A manual probe confirmed the child receives and exits on all three signals.
  • Earlier commit on this branch: docs-site build and the official Docker manifest digest check.
  • The full local suite was not run (bounded parallel-lane scope). Exact-head PR CI covers the test jobs on 1.4.0; the coordinator's final Cross-platform CI lane=all dispatch covers the runtime-role jobs on 1.4.2. Windows streaming proof is the reporter's controlled A/B: Bun 1.4.2 delivered all six upstream writes, 1.4.0 failed.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. Workflow, action and dependency changes received an independent review at the final head.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 7, 2026 13:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T01:37:20.048688Z d8ae70c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 7, 2026
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8f657238-bceb-4298-adf3-c69bd6afec90
📥 Commits

Reviewing files that changed from the base of the PR and between 954be2f and e6fb5ef.

📒 Files selected for processing (35)
  • .github/actions/setup-project-bun/action.yml
  • .github/workflows/ci.yml
  • .github/workflows/dev-version-bump.yml
  • CONTRIBUTING.md
  • Dockerfile
  • README.md
  • docs-site/src/content/docs/contributing.md
  • docs-site/src/content/docs/fr/contributing.md
  • docs-site/src/content/docs/tr/contributing.md
  • gui/package.json
  • package.json
  • readme/README.fr.md
  • readme/README.ja.md
  • readme/README.ko.md
  • readme/README.ru.md
  • readme/README.tr.md
  • readme/README.zh-CN.md
  • readme/README.zh-TW.md
  • readme/i18n-manifest.json
  • scripts/lib/test-runner-bun.ts
  • scripts/openai-provider-option-final-gates.ts
  • scripts/release.ts
  • scripts/test-layout/layout.json
  • scripts/test-layout/verify.ts
  • scripts/test-with-pinned-bun.ts
  • scripts/test.ts
  • structure/ops/docs-and-release.md
  • structure/runtime.md
  • tests/ci-workflows/ci-scope-gaps.test.ts
  • tests/ci-workflows/docs-bun-source-requirement.test.ts
  • tests/ci-workflows/install-scripts.test.ts
  • tests/ci-workflows/release-helper.test.ts
  • tests/ci-workflows/test-runner-bun.test.ts
  • tests/fixtures/test-layout-expected.json
  • tests/test-layout-tooling.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7978e98d-8547-477f-8e01-9557c95c2bee
📥 Commits

Reviewing files that changed from the base of the PR and between 42a571f and 954be2f.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • Dockerfile
  • docs-site/src/content/docs/guides/remote-hub.md
  • package.json
  • structure/ops/docs-and-release.md
  • tests/ci-workflows/install-scripts.test.ts
  • tests/storage/storage-worker-teardown-isolate.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The bundled Bun version changes from 1.4.0 to 1.4.2 in the package dependency and Docker image pin. Documentation and test expectations are updated, along with comments about the Windows transport regression and worker lifetime model.

Changes

Bun version update

Layer / File(s) Summary
Version pin and supporting references
package.json, Dockerfile, tests/ci-workflows/install-scripts.test.ts, tests/storage/storage-worker-teardown-isolate.test.ts, docs-site/src/content/docs/guides/remote-hub.md, structure/ops/docs-and-release.md
The package dependency, Docker image, test expectation, and documentation now refer to Bun 1.4.2. Test comments describe the Windows fetch-streaming regression and retain the green lane=all dispatch requirement. A worker lifetime comment now attributes the model to Bun 1.4.0.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 954be

The version pin and supporting references are aligned, with no actionable merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 2 | ❌ 1 | ❓ 2

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title correctly identifies shipping Bun 1.4.2, but it incorrectly states that the CI test runner remains on Bun 1.4.0. The changes update the package dependency assertion to Bun 1.4.2 in tests/ci-… Change the title to reflect the actual scope, for example: "fix(runtime): pin bundled Bun runtime to 1.4.2".
Linked Issues check ❓ Inconclusive Issue #6684 requires successful multi-write SSE relay for both streaming /v1/chat/completions and /v1/responses. The PR summary reports a Windows A/B in which Bun 1.4.2 delivered all six upstream … Provide evidence that the Windows A/B or equivalent automated test confirms successful multi-write relay for both endpoints, and reviewable evidence that the lockfile resolves the bundled Bun runtime to 1.4.2.
Out of Scope Changes check ❓ Inconclusive The reviewable changes described in the summary—Bun version assertions, Docker image pin, tests, and documentation—support the runtime update for issue #6684. However, bun.lock is listed in `ignored… Provide reviewable evidence for the bun.lock diff so its changes can be checked for scope.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Linked Issues check

Explanation

Issue #6684 requires successful multi-write SSE relay for both streaming /v1/chat/completions and /v1/responses. The PR summary reports a Windows A/B in which Bun 1.4.2 delivered all six upstream writes and Bun 1.4.0 failed. The available report does not identify which routes the A/B covered. The package assertion and Bun pin change are reported, but bun.lock is excluded from review, so its resolved runtime version cannot be independently confirmed.

Full details: Out of Scope Changes check

Explanation

The reviewable changes described in the summary—Bun version assertions, Docker image pin, tests, and documentation—support the runtime update for issue #6684. However, bun.lock is listed in ignored_files and was intentionally excluded from the summary. The PR description says its changes are limited to Bun entries, but the excluded diff prevents independent confirmation that it contains no unrelated changes.

Full details: Title check

Explanation

The title correctly identifies shipping Bun 1.4.2, but it incorrectly states that the CI test runner remains on Bun 1.4.0. The changes update the package dependency assertion to Bun 1.4.2 in tests/ci-workflows/install-scripts.test.ts, and the PR objective is to align the bundled runtime and Docker build with Bun 1.4.2.

✨ Finishing Touches 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 954be2f553

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
"@modelcontextprotocol/sdk": "^1.30.0",
"@napi-rs/keyring": "1.3.0",
"bun": "1.4.0",
"bun": "1.4.2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the known-crashing Bun runtime out of the test path

Pinning dependencies.bun to 1.4.2 also makes .github/actions/setup-project-bun select that version for every CI job, even though the changed test documents that this exact runtime reproducibly segfaults when bun test --isolate reloads the preload across multiple files, including repeated Windows shard failures. The current batch wrapper treats the first runtime crash as a shard failure, so the focused four-file run does not establish that normal CI or bun run test can complete; retain 1.4.0 or use a fixed runtime until the required full lane=all run is green.

AGENTS.md reference: AGENTS.md:L445-L452

Useful? React with 👍 / 👎.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Holding this pin. Exact-head Cross-platform CI 37631558263 shows Bun 1.4.2 crashing the existing test runner with Segmentation fault at address 0x10 during multi-file bun test --isolate on Linux 1/4, macOS 2/2 and Windows 9/9; the same files pass one at a time. The pin itself is correct (lock integrity and the oven/bun 1.4.2 image digest were verified), but the runtime cannot become the project default until the runner crash is resolved upstream or worked around. Back to draft.

@lidge-jun lidge-jun changed the title fix(runtime): pin Bun 1.4.2 so Windows streams survive Bun.fetch fix(runtime): ship Bun 1.4.2 and keep the CI test runner on 1.4.0 Oct 8, 2026
@lidge-jun lidge-jun added the gui-screenshot-waived Maintainer waiver for false-positive GUI screenshot requirements label Oct 8, 2026
@lidge-jun
lidge-jun marked this pull request as ready for review October 8, 2026 01:34
@lidge-jun
lidge-jun merged commit 8d30945 into dev Oct 8, 2026
83 of 86 checks passed
@lidge-jun
lidge-jun deleted the codex/bun-1.4.2-windows-streaming branch October 8, 2026 03:32
geunwoojun99 added a commit to geunwoojun99/opencodex that referenced this pull request Oct 8, 2026
Merge b1e1735 additively after the specified dev c0f8165. The four newer upstream commits are 18a8cda (lidge-jun#6731), 13348ce (lidge-jun#6729), 8d30945 (lidge-jun#6713) and b1e1735 (lidge-jun#6732); their history is preserved unchanged.

The only content conflict is src/combos/jev.ts, where lidge-jun#6731 edited the endpoint resolver that the P0 exchange extraction moved to src/combos/jev-service-exchange.ts. This merge keeps the P0 side of jev.ts byte for byte. The exchange resolver still applies the pre-lidge-jun#6731 trailing-slash normalization after this commit; carrying the shared endpoint authority into it is a separate follow-up commit.

Co-authored-by: SeongwoongCho <35558061+SeongwoongCho@users.noreply.github.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
@lidge-jun lidge-jun mentioned this pull request Oct 8, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gui-screenshot-waived Maintainer waiver for false-positive GUI screenshot requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant