Repository navigation
fix: surface failures GAIA was hiding and drop dead code - #4618
Conversation
A broken ~/.gaia/config.json made the Agent UI silently report the "chat" profile, and a stopped or missing Lemonade sent users to lemonade-server.ai with a promise that GAIA would start it - printed after auto-start had already failed. These now say what went wrong and point at `gaia init` or the start command resolved for this machine. - Agent UI status carries the config load error and the banner shows it - Lemonade remedies lead with `gaia init`; GAIA's own server counts as installed, so its users get the start hint instead of "not installed" - `gaia init` shows hub-catalog and config-reset warnings on the console and logs through gaia.logger - Email/GAIA sidecar connection errors append the resolved start hint - Agent-loop notify failures are logged with the session id - Removed the unreferenced install-ui scripts, the retired litellm extra, the uncalled interactive menu and the unused device-to-recipe map
|
Verdict: Approve with suggestions This PR stops hiding two kinds of failure. A broken Nothing blocks merge. Three things are worth a look:
Real-world evidenceN/A: no evidence bundle was produced for this run. This verdict rests on static review and the unit tests in the diff. The UI banner ( 🔍 Technical details🟡 No real-world evidence for user-visible surfaces (nudge, not a blocker)
🟢 🟢 Dismissing the config banner hides a Lemonade-down banner too ( 🟢 The sidecar hint now repeats itself ( Strengths
|
…installed LemonadeClient.initialize now counts GAIA's embedded Lemonade as installed, and reports an unreachable LEMONADE_BASE_URL as not reachable instead of telling the user to run gaia init. The sidecar relay hints drop their own start sentence so the resolved start instruction is the only remedy.
The config-error banner is no longer dismissable, since its dismiss flag also suppressed the Lemonade-down warning. A non-UTF-8 config.json now raises GaiaConfigError, so the status endpoint reports it instead of returning 500.
|
🟡 The SDK fix for GAIA's own Lemonade stops one step short. A user who ran 🔍 Technical details
|
Merge after amd#4618 — this branch contains its commits. The Agent UI status endpoint hid its own probe failures. When the model-catalog, inference-stats, device or disk check failed, the response still looked complete: the GPU row went blank, download state stayed unknown and stats disappeared, with nothing to say why. Each failure is now listed in a new `probe_warnings` field on `/api/system/status` and logged at warning. The UI doesn't render the field yet (no Node on the authoring machine), but the API exposes it and the TS types include it. Memory upkeep also no longer stops silently: if the agent's consolidate/reconcile methods are renamed, wiring them now fails loudly. <details> <summary>🔍 Technical details</summary> - Probes catch transport, JSON and payload-shape errors (`httpx.HTTPError`, `ValueError`, `TypeError`, `AttributeError`) instead of `Exception`. Anything else falls through to the existing "Lemonade health query failed" path, which now logs its cause. - The UI polls status, so each probe logs at warning once per distinct message and at debug after that. - The `urlparse` try/except was dead code (it never raises) and is removed. - `_register_agent_memory_ops` checks `isinstance(agent, MemoryMixin)` and then reads the attributes directly. Agents without memory are still skipped. - `disk_space_gb` still defaults to `0.0` when the disk probe fails, because making it nullable would need a frontend change I couldn't verify without Node. The new warning explains the 0. - The schema was regenerated with `python -m gaia.ui.export_openapi`, with this worktree's `src` on `PYTHONPATH`. The `api.gen.ts` line was added by hand to match the generator's output. </details> ## Test plan - [x] `pytest tests/unit/chat/ui/test_status_probe_failures.py`: stats, device, catalog (exception and HTTP 500) and disk failures each appear in `probe_warnings`, Lemonade stays "running", repeat failures log at warning once, memory-op wiring (registers, skips, fails on a renamed method), and the store-close failure is logged - [x] `pytest tests/unit/test_init_command.py tests/unit/installer tests/unit/chat/ui tests/unit/test_memory_router.py tests/unit/test_ui_gpu_detection.py tests/integration/test_memory_api_integration.py` (1658 passed), run with fresh `GAIA_HOME` / `GAIA_DAEMON_HOME` - [x] `test_export_openapi` passes against the regenerated schema - [ ] `cd src/gaia/apps/webui && npm run gen:api-types` produces no diff to `api.gen.ts` --------- Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
… point (amd#4657) Right after `gaia init`, if GAIA's own Lemonade is stopped (after a reboot, a crash, or `gaia lemonade embedded stop`), `gaia llm`, `gaia chat`, `gaia api`, every agent constructor, the TUI and `initialize_lemonade()` look for a system Lemonade. They find none and tell the user to run the `gaia init` they already ran. Only the Agent UI server started the right one. Now every start path checks one resolver and starts GAIA's server through the daemon. If that start fails, the daemon's error is shown and nothing tries a system install. <details> <summary>🔍 Technical details</summary> - **Cause.** `ensure_ready` only started the embedded server when the caller pinned no URL. The CLI pins env host and port, and the Agent base pins the URL it resolved while the server was stopped. Both fell through to `/daemon/v1/lemonade/start`, whose `LemonadeSupervisor` only knows `resolve_lemonade()`. `LemonadeClient.initialize` / `launch_server` resolved the system launcher directly. - **Fix.** `gaia_runs_lemonade(base_url)` in `lemonade_launcher.py` is the single decision. It is true when the embedded server is installed, `LEMONADE_BASE_URL` is unset, and the URL is unset or is the one GAIA resolves on its own. `ensure_ready`, the supervisor (now given the daemon's `EmbeddedLemonadeOwner`), `launch_server`, `_check_lemonade_installed`, `start_embedded_if_stopped` and `describe_start_hint` all go through it. The embedded server binds a random port, so `ensure_ready`, the Agent base and `launch_server` re-resolve after starting it. - **Not a start path.** `AgentSDK` construction never starts a server; its first request fails with the provider's client hint. - **Overlap.** This conflicts textually with amd#4618 in `LemonadeClient._check_lemonade_installed`, where both add an "embedded counts as installed" check. Either can merge first; on rebase keep this PR's `gaia_runs_lemonade(self.base_url)` line and amd#4618's message changes. It doesn't touch the functions changed by amd#4627, amd#4632 or amd#4543. </details> ## Test plan - [x] `pytest tests/unit/test_gaia_lemonade_start_path.py` covers the cold state: embedded installed and stopped, no system Lemonade. The tests patch only the daemon, HTTP, `Popen` and the launcher resolver. Each case asserts the daemon started GAIA's server, the system launcher was never consulted, nothing was spawned, and the caller ended up on the new port. Cases: CLI, Agent base, UI server, `initialize_lemonade`, `create_lemonade_client`, the daemon supervisor, and failure paths. - [x] Related suites pass: `test_lemonade_manager_autostart`, `test_lemonade_supervisor`, `test_lemonade_launcher`, `test_lemonade_service`, `test_daemon_lemonade`, `test_daemon_lemonade_routes` - [ ] On a machine with only `gaia init`'s Lemonade: `gaia lemonade embedded stop`, then `gaia llm "hi"` answers instead of saying Lemonade is not installed - [ ] Same state, TUI: the model server comes up without a "could not find one to start" error Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
A corrupt
~/.gaia/config.jsonmade the Agent UI quietly report the "chat" profile, and a stopped or missing Lemonade sent users to lemonade-server.ai — then promised GAIA would start it, in a message printed after auto-start had already failed. Users now see what broke and a command that fixes it: the UI shows the config error in a banner, Lemonade remedies lead withgaia init(or the start command resolved for this machine), andgaia initprints hub-catalog and config-reset warnings instead of only logging them. Also removes code nothing calls.gaia initremedies;gaia initwarnings shown on the console; sidecar connection errors get the start hint; agent-loop notify failures logged with the session id; no more mentions of the removedlemonade-serverbinary.install-uiscripts (they also linked to a 404 page), thelitellmextra (the docs already say it's gone), the interactive menu nothing calls, and a device→recipe map whose only use was a debug log.Test plan
pytest tests/unit/chat/ui tests/unit/test_init_command.py tests/unit/test_lemonade_not_running_remedy.py tests/unit/test_email_sidecar_relay.py tests/unit/test_no_removed_lemonade_cli.py tests/unit/test_amd_gaia_urls.py, withGAIA_HOMEandGAIA_DAEMON_HOMEpointed at fresh temp dirstsc(CI): the newConnectionBannercase and theconfig_errorfield in the API types~/.gaia/config.json, then rungaia chat --ui: the banner names the file and how to fix it