Skip to content

chore(nix): pin Bun 1.4.4 so gated commands get blocking stdio - #528

Merged
kixelated merged 1 commit into
mainfrom
chore/bun-1.4.4
Nov 7, 2026
Merged

kixelated merged 1 commit into
mainfrom
chore/bun-1.4.4

Conversation

@kixelated

@kixelated kixelated commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Bun 1.4.2 marks quest gate's own piped stdout or stderr O_NONBLOCK. That flag lives on the open file description its command inherits, so the command starts with non-blocking stdio. uv then panics on the first EAGAIN and aborts with no message (astral-sh/uv#22170). Bun 1.4.4 clears the flag before spawning (oven-sh/bun#43868).

A consumer whose flake makes quest's nixpkgs follow its own, newer nixpkgs already gets 1.4.4. A quest built from this flake's own lock still uses 1.4.2.

Change

  • package.json: packageManager is now bun@1.4.4. CI's setup-bun steps read it through bun-version-file. There is no engines field, and bun.lock doesn't record the Bun version.
  • flake.nix: adds a nixpkgs-bun input and an overlay that takes only bun from it. The packages, the dev shell, quest-pinned and the bun-version check all pick it up. It's locked to nixpkgs-unstable 9d3b8db, which ships Bun 1.4.4.
  • test/gate.test.ts: adds a Linux-only regression test. It runs the real CLI's quest gate with stdout and stderr piped, and checks that the gated command's fds 1 and 2 don't have O_NONBLOCK, by reading /proc/self/fdinfo.

Choices made without asking

  • Bun only, not a nixpkgs bump. Current nixpkgs (d3b13ad), and also 58deea6 from moq-dev/quest#502, still ship Bun 1.4.2. The rev that ships 1.4.4 also moves opencode from 2.1.1 to 2.2.5. The opencode-client check would then need @opencode/client bumped too, which is the runner's sandboxed opencode path and outside this fix. The flake comment says to drop nixpkgs-bun once nixpkgs reaches 1.4.4. Dependabot's nix group keeps both inputs moving until then, and bun-version still fails if they drift from packageManager.
  • A test rather than only a manual repro. The flags are read directly and nothing depends on timing, so the test doesn't flake. It skips off Linux, which has no /proc/self/fdinfo.

Validation

  • New test on this branch's Bun 1.4.4: passes. On Bun 1.4.2 (PATH=<bun-1.4.2>/bin:$PATH bun run test test/gate.test.ts -t "piped output blocks"): fails with expected 2048 to be +0, which is O_NONBLOCK on fd 1.
  • Manual repro: spawn bun src/cli/bin.ts gate -- grep -h ^flags: /proc/self/fdinfo/1 /proc/self/fdinfo/2 with stdout and stderr piped. I ran it from both Node and Bun parents, with and without QUEST_GATE_ADMITTED.
    • Bun 1.4.2: 04002 / 02 in every case.
    • Bun 1.4.4: 02 / 02 in every case.
  • just check: pass. just test: pass (29 files; 1089 passed, 5 skipped; shell hook, install and installer suites passed).
  • nix flake check: all checks passed, including bun-version, opencode-client, package and quest-tree.
  • nix build .#default: the bundle's shebang is …-bun-1.4.4/bin/bun --no-env-file. nixpkgs-bun gives Bun 1.4.4 on all three flake systems.
  • Conflicts: none with moq-dev/quest#500 (not touched), moq-dev/quest#502 or moq-dev/quest#499. I checked each with git merge-tree.

Downstream runner

A self-hosted land runner that builds quest from its own pinned rev of this flake still runs quest on Bun 1.4.2. I checked that read-only, from the shebang of its installed bundle. This PR doesn't reach it until that pin is bumped past this change, which is the runner owner's job. I didn't change the runner.

Suggested follow-ups

  • Bump the downstream runner's quest pin once this lands.
  • Remove nixpkgs-bun with the next nixpkgs bump that brings Bun 1.4.4 and its matching opencode/@opencode/client update.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, high effort

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, medium effort
  • Session: 01a1b372-5dc8-7443-80d3-56bae0a47e0a, round 1
  • Head: d30c729
  • Base: origin/main at a3789c7
  • Score: 10/10, The specified diff consistently pins Bun 1.4.4 and its regression scenario passes directly, with no actionable defects found; full checks were blocked by the read-only environment.
  • Findings: none

Addressed the online review: removed private-repository links and host-specific details from this description.

🤖 Generated with Claude Code

(Written by Opus 5.5 with high)

Bun 1.4.2 marks the gate's piped stdout or stderr O_NONBLOCK, a flag on
the open file description its command shares, and uv aborts on the
EAGAIN that follows (astral-sh/uv#22170). Bun 1.4.4 clears it before
spawning (oven-sh/bun#43868).

nixpkgs still ships 1.4.2, and the rev that ships 1.4.4 also moves
opencode, which the runner pins through @opencode/client. So take only
Bun from a second nixpkgs input, locked to the rev moq.pro uses, and
bump packageManager to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pullfrog

pullfrog Bot commented Nov 7, 2026

Copy link
Copy Markdown

Pullfrog  | Review this ➔

@kixelated
kixelated marked this pull request as ready for review November 7, 2026 00:40

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed head d30c729 against base a3789c7.

[P2] Remove private-repository references from the public PR description.
Location: PR description, Problem, Change, Land runner, and Suggested follow-ups sections. The description includes private-repository links and host-specific operational details. assets/CONTEXT.md explicitly prohibits private-repository links in public repositories and requires justifying the work on its own merits. Remove those references and operational details, retaining the generic blocking-stdio reproduction, public upstream links, version rationale, and validation. Keep any deployment coordination in its appropriate private destination.

No actionable implementation defect found in the four-file diff. The Bun overlay feeds the package builds, development shell, and version check; the locked upstream package declares Bun 1.4.4 for all three flake systems. The public Bun fix in oven-sh/bun#43868 is included in bun-v1.4.4, and the new test exercises inherited stdout/stderr flags through the real CLI.

Static review only through the GitHub connector. I did not execute code, tests, builds, or Nix evaluation, and have not independently reproduced the reported validation results.

(Written by review (OpenAI))

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The flake now uses a separate nixpkgs input for Bun and continues to use the existing nixpkgs input for other packages. The package manager version in package.json is updated to Bun 1.4.4. A Linux-only test checks that a gated command with piped output exits successfully and that stdout and stderr do not have the O_NONBLOCK flag.

Merge Risk: Minimal · up to d30c7

The Nix workflows select Bun 1.4.4. No merge-blocking risk was identified; the separate runner still needs its planned update.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title identifies the Bun 1.4.4 update and its blocking stdio objective.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description matches the Bun version update, Nix overlay, and Linux regression test.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f76469c4-7a31-4814-b5d6-cdf70f6e7571
Commits

Reviewing files that changed from the base of the PR and between a3789c7 and d30c729.

Files ignored due to path filters: 1

  • flake.lock is excluded by !**/*.lock
Files selected for processing: 3

  • flake.nix
  • package.json
  • test/gate.test.ts

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

@kixelated
kixelated added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 97d21a5 Nov 7, 2026
22 checks passed
@kixelated
kixelated deleted the chore/bun-1.4.4 branch November 7, 2026 07:24
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