fix(cli): launch subcommands with the active Python interpreter - #749
fix(cli): launch subcommands with the active Python interpreter#749imMamdouhaboammar wants to merge 1 commit into
Conversation
|
Windows + uv reproduction & verification (real environment, not mocked) I hit this exact bug on Windows 11 with Root cause, confirmed by experiments (uv uv 0.12.1 (329541a50 2026-07-31 x86_64-pc-windows-msvc), Python 3.12):
After applying this PR's one-line change ( Thanks for the focused regression tests — they cover exactly the dispatch boundary. This also explains the closed PRs #551/#502: the bug only surfaces when |
Problem
The
gaconsole script can be installed and run from a virtual environment or another explicit Python interpreter, but every Python-based frontend command inga_cli/cli.pystarts with the literal executable namepython.That can resolve to a different interpreter than the one running
ga, or fail entirely on systems where onlypython3exists. It also conflicts withcmd_update(), which already usessys.executablecorrectly.Fix
Normalize only Python launcher commands inside
launch_frontend(): when the command's first token is exactlypython, replace it withsys.executable. Non-Python runtimes are left untouched.This keeps the command registry readable and avoids editing each command definition separately.
Verification
TDD was performed on a separate validation branch:
31166383679failed becauselaunch_frontend()passedpythoninstead of the active interpreter path; the non-Python launcher case already passed31166445434: compile, both regression tests, andgit diff --checkmainas one clean commit with no temporary CI filesScope
main