Repository navigation
fix(installer): install and suggest packages that work on the installer's venv - #4617
Conversation
…er's venv The one-line installer builds ~/.gaia/venv with `uv venv`, which has no pip and is never activated. On that venv `gaia init` could not install the [rag] extras (bare `uv pip install` finds no venv; `python -m pip` does not exist), swallowed every failure and still printed "initialization complete" with document Q&A broken. The agent-install and Agent UI hints printed the same dead commands, and init told pip users to run `gaia-tui`, which only the installer provides. - One resolver picks the installer that can write into this interpreter: `python -m pip` when pip is importable, else `uv pip install --python <sys.executable>`; with neither it raises with a remedy. - `gaia init` installs extras through it and exits non-zero on failure, showing the installer's stderr and the exact retry command. - Agent-install and Agent UI hints print the same resolved command. - The completion screen names `gaia-tui` only when it is on PATH, and otherwise points at the installer.
|
Verdict: Approve with suggestions On a one-line-installer machine, Worth tidying, none of it blocking:
Real-world evidenceN/A: this run produced no evidence bundle. The verdict rests on static review alone. The PR description reports a manual check against a real 🔍 Technical detailsIssues 🟢 Install subprocess lost its timeout ( try:
result = subprocess.run( # noqa: S603 - argv is constructed, not shell
argv, capture_output=True, text=True, check=False, timeout=900
)
except subprocess.TimeoutExpired:
self._print_error(
f"Installing [{extras_str}] extras timed out. "
f"Run `{retry}` yourself, then re-run `gaia init`."
)
return False
except OSError as e:🟢 🟢 Notes (no action needed)
Strengths
|
…n GAIA's bin dir A hung download now fails gaia init after 15 minutes with the retry command instead of hanging silently. The completion screen no longer tells someone who already ran the installer to run it again when gaia-tui is in GAIA's bin dir but not on PATH. Registers the reviewed S603 suppression for the extras install and narrows the format_command quoting claim.
The NSIS installer puts gaia-tui.exe in its own InstallDir (default %LOCALAPPDATA%\Programs\GAIA, recorded under HKCU\Software\AMD\GAIA), not GAIA's bin dir. gaia init now checks there too, so a Windows user whose PATH hasn't picked it up yet isn't told to run the installer again.
# Conflicts: # src/gaia/cli.py # src/gaia/installer/init_command.py
`gaia init` printed "failed models may be corrupted, here's how to delete them" and then exited 0 with the completion banner, so scripted installs and CI counted a setup whose model can't answer as done. Now a model that fails its inference test ends init with exit 1 and an error naming the model, under the same fix steps. Two softer cases stay non-fatal, because setup still works, but are no longer quiet: a model whose context size Lemonade doesn't report gets a warning with the fix, and a failed Windows Installer process check is announced (msiexec still fails loudly with 1618 on a real conflict). Overlap: amd#4617 and amd#4520 also edit `init_command.py`, but in different hunks. This branch merges cleanly with both, so merge order doesn't matter. ## Test plan - [x] `pytest tests/unit/installer/test_init_verify_fails_on_bad_models.py`: init exits 1 with the fix steps on a failed model and exits 0 when all pass; the unverified-ctx warning and log entry; the announced msiexec-check failure. 4 of the 5 tests fail on `main`. - [x] `pytest tests/unit/test_init_command.py tests/unit/installer tests/unit/chat/ui tests/unit/test_context_size_resolution.py` (1459 passed), run with fresh `GAIA_HOME` / `GAIA_DAEMON_HOME` - [ ] On a machine with a deliberately truncated model file, `gaia init --profile <p> --yes` exits non-zero and prints the delete/re-download steps --------- Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
- source_install_command now builds on pip_install_hint (resolve_pip_frontend) - Version pin + --force-reinstall --no-deps re-threaded through that shape - agent_import_error_message/agent_wheel_failed_message kept; callsites updated - Test in SourceInstallCommand adapted to pip_install_hint fixtures
On a machine set up with the one-line installer,
gaia initreported "initialization complete" while document Q&A was broken: the installer's Python environment has nopipand is never activated, so every way init tried to install the[rag]extras failed, and init swallowed the error. Now init installs withuv pip install --python <GAIA's python>(orpipwhere the environment has it), and a failed install failsgaia initwith the installer's error and the exact command to retry. The "install the chat agent" and Agent UI "missing dependencies" hints print that same working command instead of one that errors. The completion screen also stops telling pip users to rungaia-tui, which only the installer provides; it now points them at the installer.Test plan
pytest tests/unit/installer/test_init_pip_extras.py tests/unit/agents/test_install_hints.py tests/unit/installer/test_init_default_profile.py: checks the exact argv (--pythonflag present; uv vs pip chosen by what exists), that a failed install makesgaia initexit 1 with stderr shown, and that thegaia-tuiline appears only when it is on PATHtests/unit/installer/,tests/unit/agents/,test_init_command.py,test_webui_build.py,test_amd_gaia_urls.py) pass with isolatedGAIA_HOME/GAIA_DAEMON_HOMEuv venv:python -m pipfails with "No module named pip", bareuv pip installfails with "No virtual environment found", and the--pythonform installscurl -fsSL https://amd-gaia.ai/install.sh | shbox,gaia initinstalls[rag], andpython -c "import faiss"works in~/.gaia/venvinstall.ps1