Skip to content

feat(shell): prioritize bun global bin in bash/fish/zsh PATH - #1887

Merged
shunkakinoki merged 5 commits into
mainfrom
feat/bun-global-path-front
Jun 4, 2026
Merged

feat(shell): prioritize bun global bin in bash/fish/zsh PATH#1887
shunkakinoki merged 5 commits into
mainfrom
feat/bun-global-path-front

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add $HOME/.bun/install/global/node_modules/.bin as the highest-priority PATH entry in bash, fish, and zsh
  • Mirrors the existing pattern that prepends ~/.bun/bin, so global packages installed via bun install -g resolve from the actual node_modules .bin directory first
  • Updated locations: bash bashrcExtra + profileExtra + bash_env.sh, zsh envExtra + initContent, fish shellInit + loginShellInit + interactiveShellInit

Test plan

  • nix flake check --no-build passes
  • After make switch, echo $PATH in each shell shows ~/.bun/install/global/node_modules/.bin at the front
  • Globally bun add-ed CLIs still resolve as expected

Summary by cubic

Prepends $HOME/.bun/install/global/node_modules/.bin to PATH with highest priority in bash, zsh, and fish so global bun CLIs resolve first across interactive and login shells. Mirrors ~/.bun/bin precedence and ensures it wins over /opt/homebrew/bin on macOS.

  • Bug Fixes

    • Updated specs to assert the new PATH order and that bun globals win over Homebrew on macOS (bash/zsh/fish).
    • SSH config: switched IdentityFile to list type and forced * to use ~/.ssh/id_ed25519 with lib.mkForce to override @home-manager defaults.
    • Scoped llama-cpp Vulkan override to isDesktop for simpler platform handling.
  • Refactors

    • Nixfmt the SSH module header.

Written for commit a8b993d. Summary will update on new commits.

Review in cubic

Copilot AI review requested due to automatic review settings June 3, 2026 05:18
@indent-zero

indent-zero Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Promotes $HOME/.bun/install/global/node_modules/.bin to the highest-priority PATH entry across bash, zsh, and fish so CLIs installed via bun install -g resolve from the real node_modules .bin directory ahead of homebrew/nix/system binaries, mirroring the existing precedence given to ~/.bun/bin. Follow-up commits align the shell specs with the new PATH strings, add regression tests that bun globals sit after /opt/homebrew/bin (so it wins on macOS), make llama-cpp Linux-only to dodge a flaky libuv kqueue assertion in the WebUI npm build on macOS CI, and switch programs.ssh.settings.*.IdentityFile to a single-element list with lib.mkForce on the wildcard host so the user's id_ed25519 overrides the home-manager default id_rsa that enableDefaultConfig = false no longer suppresses.

  • home-manager/programs/bash/bash_env.sh: adds a fourth case-guarded prepend for non-interactive bash (BASH_ENV).
  • home-manager/programs/bash/default.nix: appends the new dir as the last export PATH=... in bashrcExtra and as the leftmost element in profileExtra.
  • home-manager/programs/zsh/default.nix: same treatment in envExtra (leftmost) and initContent (last prepend).
  • home-manager/programs/fish/default.nix: prepends in shellInit and adds a trailing fish_add_path -p -m ~/.bun/install/global/node_modules/.bin in both loginShellInit and interactiveShellInit.
  • spec/atuin_history_spec.sh: updates the three literal grep -F PATH assertions, adds .bun/install/global/node_modules/.bin to their should include checks, and adds three new awk-based ordering tests verifying bun globals come after /opt/homebrew/bin in each shell file.
  • home-manager/programs/ssh/default.nix + spec/ssh_config_spec.sh: converts IdentityFile = "<path>" to IdentityFile = [ "<path>" ] in three host blocks, wraps the wildcard "*" entry with lib.mkForce to override the home-manager default, and pulls lib into the module signature.
  • home-manager/packages/default.nix: removes llama-cpp from the cross-platform package list and moves it into the lib.optionals stdenv.isLinux block. Linux desktop still gets llama-cpp.override { vulkanSupport = true; }; Linux non-desktop still gets plain llama-cpp; macOS no longer installs llama-cpp.

Issues

No issues found.

CI Checks

shell-test (and its aggregator shell-check) is failing because three assertions in spec/atuin_history_spec.sh (lines 113, 121, 144) grep -F for the exact pre-change PATH-setup lines in zsh envExtra, bash profileExtra, and fish shellInit — which this PR intentionally rewrote to prepend $HOME/.bun/install/global/node_modules/.bin. The tests need to be updated to match the new strings. nix-darwin (and its aggregator nix-check) is failing with a home-manager SSH module type conflict on programs.ssh.settings.*.data.IdentityFile that is unrelated to this PR — same failure would happen on main. docker-build-push (and its aggregator docker-check) failed after a ~2h run with no available logs, almost certainly unrelated to a shell PATH change.

Failing shell-test→ Autofix
  • Three grep -F assertions in spec/atuin_history_spec.sh (around lines 113-119, 121-127, 144-150) match the pre-change PATH lines exactly. This PR prepended $HOME/.bun/install/global/node_modules/.bin to those lines, so the literal grep strings no longer match. Update each grep pattern (and the BASH_ENV test around line 145+ in bash_env.sh if it covers the new entry) to include the new directory.
Failing shell-check→ Autofix
  • Aggregator check that fails because its required shell-test job failed. Will pass automatically once shell-test is fixed.
Failing nix-darwin
  • Unrelated to this PR. Failure is The option home-manager.users.shunkakinoki.programs.ssh.settings.*.data.IdentityFile has conflicting option types in <unknown-file> and .../modules/programs/ssh.nix. Nothing in this PR touches SSH config; this is a home-manager module compatibility issue and would reproduce on main.
Failing nix-check
  • Aggregator check that fails solely because its required nix-darwin job failed. All other nix-* jobs (nix-test, nix-nixos, nix-flake, nix-lint, nix-linux, nix-format) passed. Will go green once the unrelated nix-darwin SSH-module conflict is resolved.
Failing docker-build-push (linux/amd64, amd64, ubuntu-latest)
  • Build failed after a ~2h run and logs are no longer retained for the failing step. Almost certainly unrelated to a shell PATH change — most likely a timeout or transient infra issue. Re-run the job to verify; if it consistently fails, investigate independently of this PR.
Failing docker-check
  • Aggregator check that fails solely because docker-build-push failed. Will resolve once the underlying docker build succeeds (likely just needs a re-run).

⚡ Autofix All CI Failures

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Bun global npm binaries directory to PATH initialization for Bash, Fish, and Zsh, updates tests for presence and macOS ordering, converts SSH IdentityFile values to single-element lists, and relocates/adjusts the llama-cpp package override.

Changes

Bun Global Node Binaries in Shell PATH

Layer / File(s) Summary
Bash Bun global binaries setup
home-manager/programs/bash/bash_env.sh, home-manager/programs/bash/default.nix
Bash environment script conditionally prepends $HOME/.bun/install/global/node_modules/.bin to PATH and bashrcExtra/profileExtra exports updated to include it.
Fish Bun global binaries setup
home-manager/programs/fish/default.nix
Fish shellInit, loginShellInit, and interactiveShellInit updated to add ~/.bun/install/global/node_modules/.bin into PATH initialization.
Zsh Bun global binaries setup
home-manager/programs/zsh/default.nix
Zsh .zshenv envExtra and initContent updated to include ~/.bun/install/global/node_modules/.bin in PATH exports.
PATH presence and macOS precedence testing
spec/atuin_history_spec.sh
Tests updated to assert Bun global .bin presence in generated PATHs and add macOS-specific ordering checks (awk-based) ensuring Bun precedence relative to Homebrew.

SSH IdentityFile List Format

Layer / File(s) Summary
SSH IdentityFile configuration and tests
home-manager/programs/ssh/default.nix, spec/ssh_config_spec.sh
Nix module now binds lib; IdentityFile entries for wildcard, kyber, and github.com changed to single-element lists (wrapped with lib.mkForce for wildcard); test updated to expect array rendering.

Package override relocation

Layer / File(s) Summary
llama-cpp override predicate change
home-manager/packages/default.nix
llama-cpp override moved later in the package list and the vulkanSupport = true predicate changed to check isDesktop rather than stdenv.isLinux && isDesktop.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐇 I nibble through PATHs, quick and spry,
Bun's bins now front where commands fly,
Fish, Bash, Zsh sing in one small tune,
SSH keys listed, tidy and strewn,
A rabbit cheers beneath the moon.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: prioritizing Bun's global node_modules/.bin directory in PATH across bash, fish, and zsh shells.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 pull request description clearly explains the main objective of prepending bun global node_modules/.bin to PATH across bash, fish, and zsh shells, with specific locations listed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/bun-global-path-front

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 and usage tips.

@mesa-dot-dev

mesa-dot-dev Bot commented Jun 3, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Prioritizes globally installed Bun binaries in shell PATHs across Bash, Zsh, and Fish. Also updates SSH configurations to support multi-identity arrays and simplifies platform flags for llama-cpp.

What changed?

  • home-manager/programs/bash/bash_env.sh: Appended $HOME/.bun/install/global/node_modules/.bin to PATH if not already present.
  • home-manager/programs/bash/default.nix: Configured PATH in both bashrcExtra and profileExtra to prioritize the global Bun binary directory.
  • home-manager/programs/fish/default.nix: Updated Fish initialization blocks to prepend ~/.bun/install/global/node_modules/.bin to the path.
  • home-manager/programs/zsh/default.nix: Configured Zsh envExtra and initContent to prepend the global Bun path.
  • home-manager/programs/ssh/default.nix: Enabled list/array values for IdentityFile across wildcard, kyber, and GitHub hosts, using lib.mkForce to allow overrides on the wildcard host.
  • home-manager/packages/default.nix: Cleaned up the llama-cpp override logic, enabling Vulkan based entirely on isDesktop.
  • spec/atuin_history_spec.sh: Updated integration tests to assert the presence and priority of the Bun global bin path (especially relative to Homebrew on macOS).
  • spec/ssh_config_spec.sh: Updated SSH config spec assertions to check for arrays instead of single strings.

Test plan

  • nix flake check --no-build passes
  • After make switch, echo $PATH in each shell shows ~/.bun/install/global/node_modules/.bin at the front
  • Globally bun add-ed CLIs still resolve as expected

Description generated by Mesa. Update settings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the shell configuration files for Bash, Fish, and Zsh to add the global Bun node modules binary directory ($HOME/.bun/install/global/node_modules/.bin) to the PATH environment variable, ensuring globally installed Bun packages are accessible. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 4 files

Re-trigger cubic

@mesa-dot-dev mesa-dot-dev 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.

Performed full review of 4818a0c...fa84fc8

Analysis

• Inconsistent idempotency protection across shell initialization: bash_env.sh uses proper case-based duplicate checking, but bashrcExtra, profileExtra, and zsh initContent lack this protection, risking PATH pollution with repeated entries on multiple shell invocations.

• PATH duplication across three separate bash initialization surfaces (bashrcExtra, profileExtra, bash_env.sh) without centralized policy creates maintenance burden and risk of divergence in command resolution order.

• Missing idempotent insertion patterns in zsh and inline bash exports could cause unintended command shadowing behavior if users source configurations multiple times, though Fish's built-in duplicate handling mitigates this for one shell.

• No documented specification of the intended command resolution precedence hierarchy across all shells, making it difficult to verify correctness and maintain consistency as the configuration evolves.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

0 files reviewed | 2 comments | Edit Agent SettingsRead Docs

export PATH="$HOME/.bun/bin:$PATH"
export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH"
export PATH="/opt/homebrew/bin:$PATH"
export PATH="$HOME/.bun/install/global/node_modules/.bin:$PATH"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

The bun global path is added here without idempotent duplicate checking, unlike the robust pattern in bash_env.sh (lines 22-25). In environments where both bashrcExtra and bash_env.sh are sourced, this could lead to duplicate PATH entries. Consider applying the same case-based guard pattern used in bash_env.sh, or ensure these initialization contexts are mutually exclusive.

Agent: 🏛 Architecture • Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#1887
File: home-manager/programs/bash/default.nix#L87
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
The bun global path is added here without idempotent duplicate checking, unlike the robust pattern in `bash_env.sh` (lines 22-25). In environments where both `bashrcExtra` and `bash_env.sh` are sourced, this could lead to duplicate PATH entries. Consider applying the same case-based guard pattern used in `bash_env.sh`, or ensure these initialization contexts are mutually exclusive.

export PATH="$HOME/.bun/bin:$PATH"
export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH"
export PATH="/opt/homebrew/bin:$PATH"
export PATH="$HOME/.bun/install/global/node_modules/.bin:$PATH"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

This PATH prepend in initContent lacks duplicate checking. Similar to line 35 in envExtra, if both initialization paths execute (depending on shell invocation mode), the bun global path could be added multiple times. Consider wrapping with a case statement like case ":$PATH:" in *":$HOME/.bun/install/global/node_modules/.bin:"*) ;; *) export PATH="...:$PATH" ;; esac to ensure idempotent insertion.

Agent: 🏛 Architecture • Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#1887
File: home-manager/programs/zsh/default.nix#L77
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
This PATH prepend in `initContent` lacks duplicate checking. Similar to line 35 in `envExtra`, if both initialization paths execute (depending on shell invocation mode), the bun global path could be added multiple times. Consider wrapping with a case statement like `case ":$PATH:" in *":$HOME/.bun/install/global/node_modules/.bin:"*) ;; *) export PATH="...:$PATH" ;; esac` to ensure idempotent insertion.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Home Manager shell configurations to ensure Bun global package executables resolve from Bun’s global node_modules/.bin directory with the highest PATH precedence across bash, zsh, and fish.

Changes:

  • Prepend $HOME/.bun/install/global/node_modules/.bin ahead of other user-level bin directories in zsh and fish early init.
  • Add/adjust PATH prepends in interactive/login initialization blocks for bash, zsh, and fish to keep the Bun global .bin directory at the highest priority.
  • Extend non-interactive bash environment setup (bash_env.sh) to include the Bun global .bin directory.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
home-manager/programs/zsh/default.nix Prepends Bun global .bin in both always-sourced and interactive zsh init PATH setup.
home-manager/programs/fish/default.nix Adds Bun global .bin to PATH in shellInit and to fish_user_paths in login/interactive init.
home-manager/programs/bash/default.nix Prepends Bun global .bin in bashrcExtra and profileExtra PATH setup.
home-manager/programs/bash/bash_env.sh Adds Bun global .bin handling for non-interactive bash via BASH_ENV.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +22 to +25
case ":$PATH:" in
*":$HOME/.bun/install/global/node_modules/.bin:"*) ;;
*) export PATH="$HOME/.bun/install/global/node_modules/.bin:$PATH" ;;
esac
- Align atuin_history_spec PATH assertions with new bun-globals-first order
- Add ordering assertions that bun globals win over /opt/homebrew/bin on macOS
- Switch programs.ssh.settings.*.IdentityFile to list (home-manager type)

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@spec/atuin_history_spec.sh`:
- Around line 155-170: The awk checks in the three tests use the whole file so
matches outside the target block can satisfy the assertion; update each test
that reads BASH_CONFIG, ZSH_CONFIG, and FISH_CONFIG (the tests named "prepends
bun ... in bash initExtra", "in zsh initContent", and "in fish loginShellInit")
to scope the awk search to the intended config block: have awk first detect the
block start (e.g., the marker/header for bashrcExtra/initExtra, zsh initContent,
fish loginShellInit) by setting a flag when the block header is seen and
clearing it when the next block header appears, and only record NR for brew and
bun while that flag is set, then compare order; this keeps
profileExtra/interactiveShellInit matches from affecting the bashrc/login
checks.

In `@spec/ssh_config_spec.sh`:
- Around line 14-18: Extend the spec "pins the Codex-compatible SSH identity" in
spec/ssh_config_spec.sh to also assert that the rendered SSH config includes
IdentityFile lists for the wildcard host and github.com host; after reading
"$SSH_CONFIG_NIX" add two expectations similar to the existing checks (which
already assert 'IdentityFile = [ "~/.ssh/id_rsa" ]' and 'IdentitiesOnly =
"yes"') but target the Host="*" block and the Host="github.com" block (e.g.
assert the output contains Host = "*" with IdentityFile = [ "~/.ssh/id_rsa" ]
and Host = "github.com" with IdentityFile = [ "~/.ssh/id_rsa" ]) so both kyber
and the other host entries are covered.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6c5fd546-a4dc-40a0-b1c1-57f1eb9347f2

📥 Commits

Reviewing files that changed from the base of the PR and between 4818a0c and 6d672c1.

📒 Files selected for processing (7)
  • home-manager/programs/bash/bash_env.sh
  • home-manager/programs/bash/default.nix
  • home-manager/programs/fish/default.nix
  • home-manager/programs/ssh/default.nix
  • home-manager/programs/zsh/default.nix
  • spec/atuin_history_spec.sh
  • spec/ssh_config_spec.sh

Comment on lines +155 to +170
It 'prepends bun global node_modules/.bin after homebrew in bash initExtra so it wins on macOS'
When run bash -c "awk '/export PATH=\"\\/opt\\/homebrew\\/bin:/{brew=NR} /export PATH=\"\\\$HOME\\/.bun\\/install\\/global\\/node_modules\\/.bin:/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$BASH_CONFIG'"
The status should be success
The output should eq 'ok'
End

It 'prepends bun global node_modules/.bin after homebrew in zsh initContent so it wins on macOS'
When run bash -c "awk '/export PATH=\"\\/opt\\/homebrew\\/bin:/{brew=NR} /export PATH=\"\\\$HOME\\/.bun\\/install\\/global\\/node_modules\\/.bin:/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$ZSH_CONFIG'"
The status should be success
The output should eq 'ok'
End

It 'prepends bun global node_modules/.bin after homebrew in fish loginShellInit so it wins on macOS'
When run bash -c "awk '/fish_add_path -p -m \\/opt\\/homebrew\\/bin/{brew=NR} /fish_add_path -p -m ~\\/.bun\\/install\\/global\\/node_modules\\/.bin/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$FISH_CONFIG'"
The status should be success
The output should eq 'ok'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Scope the awk precedence checks to the intended config block to avoid false positives.

Line 156 and Line 168 currently scan the entire file, so matches from profileExtra/interactiveShellInit can satisfy tests that claim to validate bashrcExtra/loginShellInit. That can hide regressions in the target block.

Suggested fix (scope by block before comparing line order)
-It 'prepends bun global node_modules/.bin after homebrew in bash initExtra so it wins on macOS'
-When run bash -c "awk '/export PATH=\"\\/opt\\/homebrew\\/bin:/{brew=NR} /export PATH=\"\\\$HOME\\/.bun\\/install\\/global\\/node_modules\\/.bin:/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$BASH_CONFIG'"
+It 'prepends bun global node_modules/.bin after homebrew in bash bashrcExtra so it wins on macOS'
+When run bash -c "awk '
+  /bashrcExtra = '\'''/ {inblk=1; next}
+  inblk && /'\''';/ {inblk=0}
+  inblk && /export PATH=\"\\/opt\\/homebrew\\/bin:/ {brew=NR}
+  inblk && /export PATH=\"\\\$HOME\\/.bun\\/install\\/global\\/node_modules\\/.bin:/ {bun=NR}
+  END { if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }
+' '$BASH_CONFIG'"

-It 'prepends bun global node_modules/.bin after homebrew in fish loginShellInit so it wins on macOS'
-When run bash -c "awk '/fish_add_path -p -m \\/opt\\/homebrew\\/bin/{brew=NR} /fish_add_path -p -m ~\\/.bun\\/install\\/global\\/node_modules\\/.bin/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$FISH_CONFIG'"
+It 'prepends bun global node_modules/.bin after homebrew in fish loginShellInit so it wins on macOS'
+When run bash -c "awk '
+  /loginShellInit = '\'''/ {inblk=1; next}
+  inblk && /'\''';/ {inblk=0}
+  inblk && /fish_add_path -p -m \\/opt\\/homebrew\\/bin/ {brew=NR}
+  inblk && /fish_add_path -p -m ~\\/.bun\\/install\\/global\\/node_modules\\/.bin/ {bun=NR}
+  END { if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }
+' '$FISH_CONFIG'"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/atuin_history_spec.sh` around lines 155 - 170, The awk checks in the
three tests use the whole file so matches outside the target block can satisfy
the assertion; update each test that reads BASH_CONFIG, ZSH_CONFIG, and
FISH_CONFIG (the tests named "prepends bun ... in bash initExtra", "in zsh
initContent", and "in fish loginShellInit") to scope the awk search to the
intended config block: have awk first detect the block start (e.g., the
marker/header for bashrcExtra/initExtra, zsh initContent, fish loginShellInit)
by setting a flag when the block header is seen and clearing it when the next
block header appears, and only record NR for brew and bun while that flag is
set, then compare order; this keeps profileExtra/interactiveShellInit matches
from affecting the bashrc/login checks.

Comment thread spec/ssh_config_spec.sh
Comment on lines 14 to 18
It 'pins the Codex-compatible SSH identity'
When run cat "$SSH_CONFIG_NIX"
The output should include 'IdentityFile = "~/.ssh/id_rsa"'
The output should include 'IdentityFile = [ "~/.ssh/id_rsa" ]'
The output should include 'IdentitiesOnly = "yes"'
End

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add assertions for wildcard and github.com IdentityFile list rendering.

This only guards kyber; the same contract change on "*" and "github.com" can regress undetected.

Suggested spec extension
 It 'pins the Codex-compatible SSH identity'
 When run cat "$SSH_CONFIG_NIX"
 The output should include 'IdentityFile = [ "~/.ssh/id_rsa" ]'
+The output should include 'IdentityFile = [ "~/.ssh/id_ed25519" ]'
+The output should include 'IdentityFile = [ "~/.ssh/id_ed25519_github" ]'
 The output should include 'IdentitiesOnly = "yes"'
 End
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
It 'pins the Codex-compatible SSH identity'
When run cat "$SSH_CONFIG_NIX"
The output should include 'IdentityFile = "~/.ssh/id_rsa"'
The output should include 'IdentityFile = [ "~/.ssh/id_rsa" ]'
The output should include 'IdentitiesOnly = "yes"'
End
It 'pins the Codex-compatible SSH identity'
When run cat "$SSH_CONFIG_NIX"
The output should include 'IdentityFile = [ "~/.ssh/id_rsa" ]'
The output should include 'IdentityFile = [ "~/.ssh/id_ed25519" ]'
The output should include 'IdentityFile = [ "~/.ssh/id_ed25519_github" ]'
The output should include 'IdentitiesOnly = "yes"'
End
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@spec/ssh_config_spec.sh` around lines 14 - 18, Extend the spec "pins the
Codex-compatible SSH identity" in spec/ssh_config_spec.sh to also assert that
the rendered SSH config includes IdentityFile lists for the wildcard host and
github.com host; after reading "$SSH_CONFIG_NIX" add two expectations similar to
the existing checks (which already assert 'IdentityFile = [ "~/.ssh/id_rsa" ]'
and 'IdentitiesOnly = "yes"') but target the Host="*" block and the
Host="github.com" block (e.g. assert the output contains Host = "*" with
IdentityFile = [ "~/.ssh/id_rsa" ] and Host = "github.com" with IdentityFile = [
"~/.ssh/id_rsa" ]) so both kyber and the other host entries are covered.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="spec/atuin_history_spec.sh">

<violation number="1" location="spec/atuin_history_spec.sh:156">
P2: The awk precedence check scans the entire config file, not just the `bashrcExtra`/`initExtra` block it claims to validate. A match from `profileExtra` or another block could satisfy this test even if the target block regresses. Scope the awk pattern to the intended config block (e.g., track entering/leaving the block) to avoid false positives.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

End

It 'prepends bun global node_modules/.bin after homebrew in bash initExtra so it wins on macOS'
When run bash -c "awk '/export PATH=\"\\/opt\\/homebrew\\/bin:/{brew=NR} /export PATH=\"\\\$HOME\\/.bun\\/install\\/global\\/node_modules\\/.bin:/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$BASH_CONFIG'"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: The awk precedence check scans the entire config file, not just the bashrcExtra/initExtra block it claims to validate. A match from profileExtra or another block could satisfy this test even if the target block regresses. Scope the awk pattern to the intended config block (e.g., track entering/leaving the block) to avoid false positives.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At spec/atuin_history_spec.sh, line 156:

<comment>The awk precedence check scans the entire config file, not just the `bashrcExtra`/`initExtra` block it claims to validate. A match from `profileExtra` or another block could satisfy this test even if the target block regresses. Scope the awk pattern to the intended config block (e.g., track entering/leaving the block) to avoid false positives.</comment>

<file context>
@@ -142,11 +144,30 @@ The output should include '.local/bin'
 End
+
+It 'prepends bun global node_modules/.bin after homebrew in bash initExtra so it wins on macOS'
+When run bash -c "awk '/export PATH=\"\\/opt\\/homebrew\\/bin:/{brew=NR} /export PATH=\"\\\$HOME\\/.bun\\/install\\/global\\/node_modules\\/.bin:/{bun=NR} END{ if (brew && bun && bun > brew) print \"ok\"; else print \"bad brew=\" brew \" bun=\" bun }' '$BASH_CONFIG'"
+The status should be success
+The output should eq 'ok'
</file context>

The llama-cpp WebUI npm step hits a libuv kqueue assertion
(Assertion failed: (errno == EINTR), function uv__io_poll) on
macOS CI runners, failing nix-darwin builds intermittently.
llama-cpp on macOS only added a CLI binary; move it under the
isLinux block.
home-manager's programs.ssh module defines a default IdentityFile of
~/.ssh/id_rsa for the "*" block, which conflicts with our id_ed25519
value during galactica eval (enableDefaultConfig = false does not
prevent this default in the current home-manager release). Use
lib.mkForce so our value wins without touching upstream.
@shunkakinoki
shunkakinoki merged commit 29f8557 into main Jun 4, 2026
33 of 34 checks passed
@shunkakinoki
shunkakinoki deleted the feat/bun-global-path-front branch June 4, 2026 06:49
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.

2 participants