GenericAgent icon indicating copy to clipboard operation
GenericAgent copied to clipboard

fix: use sys.executable instead of hardcoded 'python' for subprocess calls

Open desmonna opened this issue 6 months ago • 0 comments

Problem

On Windows with multiple Python installations (e.g. system Python + venv), hardcoded "python" in subprocess calls resolves to the system default via PATH, not the active venv interpreter. This causes child processes to miss all venv-installed packages (PyQt5, Textual, pywebview, etc.), resulting in ModuleNotFoundError on startup.

Fix

Replace all 10 occurrences of ["python", ...] with [sys.executable, ...].

sys.executable returns the absolute path of the currently running Python interpreter, guaranteeing child processes inherit the same venv environment. This is the officially recommended approach for cross-platform compatibility.

Changes

File Count What
ga_cli/cli.py 7 All CLI command entries (gui, configure, hub, tui, tui2, cli, launch)
memory/checklist_helper.py 3 BBS subprocess, worker reflection, master reflection

Testing

  • Verified ga gui, ga tui, ga cli launch correctly under venv
  • Verified checklist helper BBS/worker/master subprocesses start with correct environment

Fixes #501

desmonna avatar Jun 01 '26 06:06 desmonna