Skip to content

Commit 69555aa

Browse files
committed
fix(pi): resolve drift host attr
1 parent 196f136 commit 69555aa

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

modules/agents/pi/check-runtime-drift.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ warn() {
1010

1111
pi_home="${PI_HOME:-$HOME/.pi/agent}"
1212
repo_root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
13+
host_name="$(hostname -s 2>/dev/null || hostname)"
14+
host_name="${host_name%%.*}"
1315

1416
if [ ! -d "$pi_home" ]; then
1517
warn "Pi home not found at $pi_home; run hey re before using pi."
@@ -37,7 +39,19 @@ fi
3739

3840
if command -v pi >/dev/null 2>&1; then
3941
current_version="$(pi --version 2>/dev/null || true)"
40-
pinned_version="$(nix eval --no-write-lock-file --raw "$repo_root#nixosConfigurations.$(hostname).pkgs.llm-agents.pi.version" 2>/dev/null || true)"
42+
pinned_version=""
43+
for flake_attr in \
44+
"darwinConfigurations.$host_name.pkgs.llm-agents.pi.version" \
45+
"nixosConfigurations.$host_name.pkgs.llm-agents.pi.version"
46+
do
47+
pinned_version="$(nix eval --no-write-lock-file --raw "$repo_root#$flake_attr" 2>/dev/null || true)"
48+
[ -n "$pinned_version" ] && break
49+
done
50+
51+
if [ -n "$current_version" ] && [ -z "$pinned_version" ]; then
52+
warn "Could not resolve repo-pinned Pi version for host '$host_name'."
53+
fi
54+
4155
if [ -n "$current_version" ] && [ -n "$pinned_version" ] && [ "$current_version" != "$pinned_version" ]; then
4256
warn "Pi binary version $current_version differs from repo-pinned $pinned_version; run hey re."
4357
fi

0 commit comments

Comments
 (0)