From 2f4ec8a75e2fee3454d4d500fc04bebab3eaf190 Mon Sep 17 00:00:00 2001 From: Juan Barbat Date: Wed, 21 Oct 2026 15:38:31 -0300 Subject: [PATCH] fix(fish): add the managed Pi home (~/.pi/agent/bin) to PATH The Mac's pi lives only in the managed home and reached PATH by inheritance; once 10-core.fish owned PATH, gs could not find pi. Lowest priority, so a pi in ~/.local/bin still wins on Linux hosts. Refs #69 --- fish/conf.d/10-core.fish | 4 ++-- fish/tests/w8-linux-path.fish | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fish/conf.d/10-core.fish b/fish/conf.d/10-core.fish index ec82b87..d4331e5 100644 --- a/fish/conf.d/10-core.fish +++ b/fish/conf.d/10-core.fish @@ -59,7 +59,7 @@ if test (uname) = Darwin end end # Later entries end up first (fish_add_path --move prepends). - for tool_bin in /usr/local/bin /nix/var/nix/profiles/default/bin "$HOME/.nix-profile/bin" "$HOME/.bun/bin" "$HOME/.volta/bin" "$HOME/.opencode/bin" "$HOME/.local/bin" /opt/homebrew/sbin /opt/homebrew/bin "$HOME/.cargo/bin" + for tool_bin in "$HOME/.pi/agent/bin" /usr/local/bin /nix/var/nix/profiles/default/bin "$HOME/.nix-profile/bin" "$HOME/.bun/bin" "$HOME/.volta/bin" "$HOME/.opencode/bin" "$HOME/.local/bin" /opt/homebrew/sbin /opt/homebrew/bin "$HOME/.cargo/bin" if test -d "$tool_bin" fish_add_path --path --move "$tool_bin" end @@ -69,7 +69,7 @@ end if test (uname) = Linux # One list for every Linux host; each dir is added only if it exists. # Later entries end up first (fish_add_path --move prepends). - for tool_bin in /usr/local/go/bin $HOME/.local/go-*/bin "$HOME/.bun/bin" "$HOME/.local/share/pnpm/bin" /nix/var/nix/profiles/default/bin "$HOME/.nix-profile/bin" "$HOME/.opencode/bin" "$HOME/.local/bin" + for tool_bin in "$HOME/.pi/agent/bin" /usr/local/go/bin $HOME/.local/go-*/bin "$HOME/.bun/bin" "$HOME/.local/share/pnpm/bin" /nix/var/nix/profiles/default/bin "$HOME/.nix-profile/bin" "$HOME/.opencode/bin" "$HOME/.local/bin" if test -d "$tool_bin" fish_add_path --path --move "$tool_bin" end diff --git a/fish/tests/w8-linux-path.fish b/fish/tests/w8-linux-path.fish index 3ea6dda..e65f5ae 100644 --- a/fish/tests/w8-linux-path.fish +++ b/fish/tests/w8-linux-path.fish @@ -20,7 +20,7 @@ printf '#!/bin/sh\necho Linux\n' >"$fake/uname" chmod +x "$fake/uname" # Prefixed with $home so the test never depends on the runner's real dirs. -set -l dirs .local/go-1.27.1/bin .bun/bin .local/share/pnpm/bin .nix-profile/bin .opencode/bin .local/bin +set -l dirs .pi/agent/bin .local/go-1.27.1/bin .bun/bin .local/share/pnpm/bin .nix-profile/bin .opencode/bin .local/bin for d in $dirs mkdir -p "$home/$d" end @@ -31,7 +31,7 @@ set -l out (env -i HOME="$home" PATH="$fake:/usr/bin:/bin" "$fish_bin" --no-conf # fish_add_path --move prepends in loop order: the last listed dir ends first. # Only entries under the fake HOME: system dirs like /nix differ per runner. set -l ours (string join '|' (string match -- "$home/*" (string split '|' -- $out[1]))) -set -l expected "$home/.local/bin|$home/.opencode/bin|$home/.nix-profile/bin|$home/.local/share/pnpm/bin|$home/.bun/bin|$home/.local/go-1.27.1/bin" +set -l expected "$home/.local/bin|$home/.opencode/bin|$home/.nix-profile/bin|$home/.local/share/pnpm/bin|$home/.bun/bin|$home/.local/go-1.27.1/bin|$home/.pi/agent/bin" test "$ours" = "$expected"; or fail "Linux PATH order (expected $expected, got $ours)" string match -q -- "$home/.local/bin|*" "$out[1]"; or fail "user-local bin must lead PATH ($out[1])" test "$out[2]" = o=absent; or fail "Linux must not define the macOS open alias ($out[2])" @@ -45,14 +45,14 @@ string match -q -- "*$bare*" "$out_bare[1]"; and fail "missing dirs were added t # macOS: 10-core.fish owns PATH too (config.fish no longer edits it). printf '#!/bin/sh\necho Darwin\n' >"$fake/uname" set -l mac "$ws/mac" -set -l mac_dirs .cargo/bin .local/bin .opencode/bin .volta/bin .bun/bin .nix-profile/bin .gentle-ai/bin +set -l mac_dirs .pi/agent/bin .cargo/bin .local/bin .opencode/bin .volta/bin .bun/bin .nix-profile/bin .gentle-ai/bin for d in $mac_dirs mkdir -p "$mac/$d" end set -l out_mac (env -i HOME="$mac" PATH="$fake:/usr/bin:/bin" "$fish_bin" --no-config -c "$probe" "$core") test "$out_mac[2]" = o=defined; or fail "macOS must define the open alias ($out_mac[2])" set -l mac_ours (string join '|' (string match -- "$mac/*" (string split '|' -- $out_mac[1]))) -set -l mac_expected "$mac/.gentle-ai/bin|$mac/.cargo/bin|$mac/.local/bin|$mac/.opencode/bin|$mac/.volta/bin|$mac/.bun/bin|$mac/.nix-profile/bin" +set -l mac_expected "$mac/.gentle-ai/bin|$mac/.cargo/bin|$mac/.local/bin|$mac/.opencode/bin|$mac/.volta/bin|$mac/.bun/bin|$mac/.nix-profile/bin|$mac/.pi/agent/bin" test "$mac_ours" = "$mac_expected"; or fail "macOS PATH order (expected $mac_expected, got $mac_ours)" string match -q -- "$mac/.gentle-ai/bin|*" "$out_mac[1]"; or fail "gentle-ai launchers must lead the macOS PATH ($out_mac[1])"