Skip to content

fix: resolve symlinks before computing DIR for venv lookup - #1

Open
griffincapmisc wants to merge 1 commit into
griffinwork40:mainfrom
griffincapmisc:fix/symlink-venv-resolution
Open

fix: resolve symlinks before computing DIR for venv lookup#1
griffincapmisc wants to merge 1 commit into
griffinwork40:mainfrom
griffincapmisc:fix/symlink-venv-resolution

Conversation

@griffincapmisc

Copy link
Copy Markdown

When the ga entrypoint is invoked via a symlink (the standard AFK plugin install path — ~/.afk/skills/ga/scripts/ga → plugins/ga-cli/skills/ga/scripts/ga), $(dirname "$0") returns the symlink's directory, not the target's. This means the venv-relative paths ($DIR/../../../.venv, $DIR/../.venv) never match, and the wrapper silently falls back to system Python.

This breaks when the system Python upgrades (e.g. Homebrew 3.9 → 3.13) and pip packages are stranded in the old site-packages.

Fix: Resolve the symlink chain before computing DIR, matching POSIX readlink behavior. The venv is now found regardless of how the script is called.

When the ga entrypoint is invoked via a symlink (standard AFK plugin
install path), $(dirname "$0") returns the symlink's directory, not
the target's. This means the venv-relative paths never match and the
wrapper silently falls back to system Python — which may not have the
required packages (e.g. after a Homebrew Python major-version upgrade).

Resolve the symlink chain before computing DIR so the venv is found
regardless of how the script is called.
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