fix(installer): install the extras the daemon needs to start - #3056
Conversation
|
Verdict: Approve with suggestions — one thing to confirm before merge. This makes the installer pull the The catch: the daemon needs three things at startup — the web server, the ASGI runner, and a process-inspection library — and the extra chosen here only declares the first two. GAIA's own pre-flight check refuses to start the daemon when the third is missing. It may still land on disk today as a side effect of another dependency, but the installer isn't asking for it, so nothing guarantees it. Worth confirming with a clean-venv install followed by starting the daemon; if it's missing there, this fix doesn't finish the job and the extra should declare it. Second, nothing locks this in. A one-line assertion over the installer scripts — in the existing installer test file — would stop a future edit from quietly dropping the extras again, which is exactly how this regressed. Real-world evidenceN/A in this run — no evidence bundle was produced, and I had no access to the PR description or GitHub from the review environment, so I can't tell whether the author already attached installer output. The verdict therefore rests on static review alone. The evidence that would settle the open question is a single clean-machine run: a fresh venv installed the way the script does it, then starting the daemon and showing it come up (rather than printing the missing-dependency error). If that's already in the description, disregard the nudge. 🔍 Technical details🟡
It probably works today because "api": [
"fastapi>=0.115.0",
"uvicorn>=0.32.0",
"python-multipart>=0.0.9",
"httpx>=0.27.0",
# Daemon sidecar registry imports psutil at module scope
# (gaia/daemon/sidecars/registry.py) and _check_daemon_deps
# refuses to start without it.
"psutil>=5.9.0",
],The alternative — switching the installer to 🟡 No regression test pins the extras onto the install scripts
def test_scripts_install_the_daemon_extras(sh_text, ps1_text):
assert sh_text.count('"amd-gaia[api]"') == 2
assert ps1_text.count('"amd-gaia[api]"') == 2🟢 Nit — the daemon-deps error message names extras that don't satisfy it ( The message reads Strengths
|
|
Verdict: Approve 🟢 Tight bug-fix: the one-line installer was shipping bare Checked: One observation on the AST-based helper in
No 🔴 or 🟡 issues found. Ship it. |
The one-line installer sets up the `gaia` CLI that the terminal hub depends on,
but installed bare `amd-gaia`, which has no fastapi or uvicorn. The terminal hub
cannot do anything without the background service, so a fresh install reached
`gaia daemon` and stopped there:
gaia daemon needs packages not in the base install: fastapi, uvicorn.
Nothing downstream filled the gap: no `gaia init` profile requests `api` or
`ui` (pip_extras is [] or ["rag"] for all nine), so following the website
exactly -- install, `gaia init`, `gaia-tui` -- never installed them.
`[api]` is fastapi, uvicorn, python-multipart and httpx, and is what the daemon
actually needs; `[ui]` would also work but drags in torch and faiss for a
process that needs neither. The flagship agent ships as a frozen sidecar with
its own dependencies, so the core does not need RAG extras on its behalf.
Verified on a clean 3.12 venv: bare `amd-gaia` fails as above, and the same
venv with [api] starts the daemon, which then installs and runs the flagship
agent from the terminal hub.
…n start The installer asks for `amd-gaia[api]`, but that extra declared only fastapi and uvicorn — the daemon's own pre-flight check also requires psutil, which was arriving only as a transitive of accelerate. One resolver change away from re-breaking the exact bug this PR fixes. The daemon's error message pointed at `[ui]` "(or [api]/[dev])"; [dev] declares none of the three, so a user following it stayed broken. It now names [api] — the lean extra the installer uses — with [ui] as the heavier alternative, and docs/reference/cli.mdx says the same in both places it describes the extras. Three regression guards, all derived from cli.py's own check list so they can't drift from it: [api] covers every daemon dep, every extra the error message suggests actually satisfies it, and both installer call sites request [api].
943f70b to
9b892c2
Compare
|
Approve — Two small test-brittleness nits: 🟢 🟢 🔍 Technical details
# before
assert len(call_sites) == 2, (...)
bare = [line for line in call_sites if '"amd-gaia[api]"' not in line]
assert not bare, (...)
# after — one check, same invariant
bare = [line for line in call_sites if '"amd-gaia[api]"' not in line]
assert not bare, (...)
# before
body = src[
src.index("def _check_daemon_deps") : src.index("def handle_daemon_command")
]
# after — find the next function definition instead of naming the neighbour
start = src.index("def _check_daemon_deps")
end = src.index("\ndef ", start + 1)
body = src[start:end] |
Following the website exactly — run the one-line installer,
gaia init, thengaia-tui— leaves you unable to start the terminal hub. The installer sets up thegaiaCLI the hub depends on, but installs bareamd-gaia, which has no fastapi or uvicorn, and the hub is useless without the background service:Nothing downstream covers it — no
gaia initprofile asks forapiorui(pip_extrasis[]or["rag"]across all nine), so the packages never arrive by any route the onboarding walks.[api]is fastapi, uvicorn, python-multipart and httpx — what the daemon actually needs.[ui]would also satisfy it but drags in torch and faiss for a process that needs neither, and the flagship agent ships as a frozen sidecar carrying its own dependencies, so the core doesn't need RAG extras on its behalf.Two follow-ons landed here because installing
[api]alone still wasn't sufficient. That extra never declaredpsutil, which the daemon's own pre-flight check requires — it was arriving only as a transitive ofaccelerate, one resolver change from re-breaking this. And the error message above pointed at[dev], which declares none of the three, so a user who followed it stayed broken.This is the last blocker in the TUI onboarding path; #3054 (releasing the core that can run the flagship agent) and #3055 (its version floor) are the other two.
Test plan
amd-gaia→gaia daemon startfails naming fastapi/uvicorn/psutil, and points at[api]amd-gaia[api]→ daemon starts, andgaia daemon statuslistsgaiaas a supervised sidecarpip show psutilsucceeds — declared by the extra, not inherited fromaccelerategaia install gaia→gaia daemon start-agent gaia→ sidecar/healthreturns{"status":"ok"}pytest tests/unit/test_api_extras.py tests/unit/installer/— the new guards pass (thedashfailure is a pre-existing Windows CRLF checkout artifact;install.shparses clean under bothdash -nandbash -nwith LF endings)