Repository navigation
fix(init): count the agent a terminal package ships beside the frozen gaia - #6946
Conversation
… gaia Since the terminal packages started shipping a frozen gaia (#6783), the TUI asks that gaia whether setup is done. Its check only looked for the flagship in ~/.gaia/bin or the hub install, so on a Windows setup, .deb, .rpm or .pkg install it reported "the GAIA agent needs installing" even though gaia-agent sits beside gaia-tui. With models already on the server, the TUI halted before running any turn. The check now also accepts the agent beside the frozen gaia and, for a frozen gaia, on PATH. The headless journey's install.sh rows called ~/.gaia/venv/bin/gaia to uninstall, which the frozen install no longer creates; they now use ~/.gaia/bin/gaia and check ~/.gaia/core is removed.
|
Verdict: Approve Terminal-only installs (the Windows setup, .deb, .rpm and macOS .pkg) stopped refusing to chat once their models were already on Lemonade. The setup check now finds the agent these packages ship next to the frozen Real-world evidenceThe evidence stage ran the real Before this PR (HEAD~1), the same D and E layouts gave 🔍 Technical detailsIssues found: none blocking, and no nits worth posting. What I checked
Strengths
|
Since v0.26.0-rc6 the frozen `gaia` shipped without the web UI build, so `gaia chat --ui` served only its "This is the GAIA backend API" placeholder. Anyone opening the Agent UI in a browser or on a phone over the tunnel got no app, and every desktop journey row (win-agent-ui-exe, win-setup-ui, the .deb, AppImage and dmg rows) timed out waiting for the setup screen. Now the core build builds the UI first, the freeze bundles it and refuses to build without it, and the smoke test fails if `/` isn't the app. When setup fails, the journey rows now also upload Playwright's screenshot, trace and report. amd#6946 doesn't fix this one: it changes `gaia init`'s agent check, and this failure is the missing UI files. ## Test plan - [x] `pytest tests/unit/installer/test_core_freeze_webui.py tests/unit/installer/test_installer_headless.py tests/unit/installer/test_install_scripts_terminal_hub.py tests/unit/installer/test_readme_matches_layout.py` - [x] The smoke check accepts a real `npm run build` index.html and rejects the server's placeholder page - [x] `build_core.yml` dispatched on this branch ([run](https://github.com/amd/gaia/actions/runs/42398982613)): freeze and smoke pass on win32-x64, darwin-arm64 and linux-x64, including "serves the Agent UI at /" - [ ] Next RC: the desktop journey rows pass the setup phase
…/bin (amd#7847) After `install.ps1` or `install.sh`, `gaia -p` failed with "no verified sidecar binary" because the daemon would not start the `gaia-agent` the installer had just downloaded and checksum-verified, while `gaia init --check` counted that same copy as installed. The install scripts now record the verified agent's version and SHA-256 beside it, and the daemon starts that copy after re-hashing it against the record. A replaced or corrupt copy is still refused, with a reinstall remedy. `gaia init --check` uses the same lookup, so it stops counting a `~/.gaia/bin` copy the daemon would refuse. The error also stops leading with a lock-file path that only exists in a source checkout. **Decision taken (the issue left it open):** Option B from the maintainer's comment, narrowed to the two install scripts this issue is about. The record sits in `~/.gaia/bin` beside the binary, the same trust level as the hub's `.installed` sentinel. Anyone who can rewrite it can also replace `gaia.exe` in that folder, so the daemon's verification rule gets no wider. Option A (a digest built into `gaia`) doesn't fit `install.ps1`: it takes the agent from the hub at install time, not the one the core was built with. **Known gap, unchanged by this PR:** the terminal packages (.deb, .rpm, .pkg, Windows setup) write no record yet. The daemon still refuses their copy, as it does on `main`, and now names the copy and the fix. `gaia init --check` keeps counting those copies, because the TUI runs them directly and dropping them would bring back the amd#6946 regression. Closing that gap means each package build ships the record. That's a follow-up. ## Test plan - [x] Real `install.ps1` `Install-FlagshipAgent` (Windows PowerShell 5.1) into an empty temp profile against the live hub downloaded agent 0.3.5 plus its record. Then `gaia daemon start-agent gaia --mode user` from this branch, with that profile as `HOME`/`GAIA_HOME`: the sidecar came up from `~/.gaia/bin/gaia-agent.exe` (log: "using installer-placed verified binary … (v0.3.5)"). - [x] Same profile with one byte appended to the agent: start refused, "does not match the SHA-256 its installer recorded", with the `gaia init` remedy. After the byte was removed, it started again. - [x] `pytest tests/unit/test_daemon_sidecar_fetch.py tests/unit/test_agent_sidecar_manager.py tests/unit/test_init_command.py tests/unit/installer/test_install_scripts_terminal_hub.py`: 375 passed. The new tests fail on `main`. - [x] Adversarial cases: no record, a replaced copy, a truncated copy, a corrupt or partial or non-hex record, a record with no binary, a directory named like the agent, a recorded copy on a pip install's PATH, and the email agent all stay refused. A hub install still wins over the installer copy. - [x] Wider daemon, init and installer suites: 2195 passed. 3 TUI-detection tests fail only on this dev box, which has GAIA's NSIS install registered. They're unrelated. - [ ] CI: the POSIX `install.sh` round-trip test (`test_daemon_starts_the_agent_install_sh_placed`) runs on Linux. - [ ] Next RC: `install-ps1` / `install-sh` journey rows, `gaia -p` on a fresh profile. Closes amd#7187
Since v0.26.0-rc6 (#6783), a terminal-only install refuses to chat when the user's models are already on Lemonade. The TUI now asks the bundled frozen
gaiawhether setup is done. That check only looked for the agent in~/.gaia/binor the hub install, so it said "the GAIA agent needs installing" even thoughgaia-agentships right besidegaia-tui. This is what turned thewin-setup-tui,win-setup-both,*-tui-deb,fedora-tui-rpmandmac-*-tui-pkgjourney rows red on rc6 and rc7. The check now also counts the agent beside the frozengaiaand, for a frozengaiaonly, on PATH. Theinstall-shjourney rows were also failing at uninstall because the harness still called~/.gaia/venv/bin/gaia, which the frozen install no longer creates.Test plan
pytest tests/unit/test_init_command.py: 198 passed. The two new "ready" tests fail without the fix. The adversarial cases still report the agent missing: an agent on a pip install's PATH, beside a source interpreter, a directory namedgaia-agent, or a non-executable file.mainwhengaia-tuiis on the dev machine's PATH.win-setup-tui/win-setup-both,*-tui-deb,fedora-tui-rpmandmac-*-tui-pkgrows pass health, and the*-install-shrows pass uninstall and leftovers.