Skip to content

fix(ui): Agent UI status reports its own probe failures - #4628

Merged
kovtcharov-amd merged 7 commits into
amd:mainfrom
kovtcharov:kalin/ui-status-reports-probe-failures
Oct 4, 2026
Merged

kovtcharov-amd merged 7 commits into
amd:mainfrom
kovtcharov:kalin/ui-status-reports-probe-failures

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Merge after #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.

🔍 Technical details
  • 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.

Test plan

  • 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
  • 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
  • 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

Kalin Ovtcharov added 2 commits October 4, 2026 01:24
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
The status endpoint swallowed failures of its catalog, inference-stats,
device and disk probes, so the response looked complete while those fields
silently kept their defaults. Each failure now lands in a new
probe_warnings list on the status response and is logged at warning
(once per distinct message, since the UI polls).

- Drop the try around urlparse, which never raises, and its hard-coded
  fallback.
- A failed health query logs its cause instead of only setting the generic
  lemonade_error.
- Model preload logs a failed re-check before loading anyway.
- The memory router logs a failed store close and counts embeddings it
  cannot decode during reconcile.
- Memory upkeep is wired for any MemoryMixin agent by direct attribute
  access, so a renamed method fails loudly instead of quietly disabling
  consolidation and reconciliation.
@github-actions github-actions Bot added dependencies Dependency updates llm LLM backend changes cli CLI changes tests Test changes performance Performance-critical changes agents labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

When one of the Agent UI's status checks fails (model catalog, inference stats, device info or disk space), the status response now lists the failure instead of quietly leaving a blank field. Memory upkeep also fails loudly if the agent's methods get renamed. The changes are narrow and well tested, and none of the fixes widens an outage: a failed side check still leaves Lemonade reported as running. Nothing blocks merge.

The diff also carries #4618's commits (config-error banner, gaia init remedies, dead-code removal), as the description says. I reviewed both and found nothing blocking in either.

Worth a look before merge:

  • No real request/response is shown for the changed status endpoint. The unit tests are good, but one real curl /api/system/status with a probe forced to fail would show the new field working on the real surface.
  • A warning that comes back after a recovery is logged only at debug. The repeat-suppression never resets, so a failure that clears and then returns stays out of the warning log.

Real-world evidence

N/A: no evidence bundle was produced for this run. The verdict rests on static review and the unit tests the author reports passing. The /api/system/status change was not exercised live, and the UI doesn't render probe_warnings yet.

🔍 Technical details

🟡 Important

  • No real-surface evidence for the REST change (src/gaia/ui/routers/system.py). The PR adds probe_warnings to /api/system/status, but the description shows only pytest results. Add one real request and its response, for example with Lemonade's /stats unreachable or /models?show_all returning 500, showing the probe_warnings array and lemonade_running: true. The unchecked npm run gen:api-types item matters for the same reason, because api.gen.ts was edited by hand.

🟢 Minor

  • Repeat suppression never resets on recovery (src/gaia/ui/routers/system.py:692-702). _last_probe_warning[probe] is only overwritten, never cleared. Take a sequence of failure A, then a healthy poll, then failure A again: the second A logs at debug only. Clearing the entry when a probe succeeds keeps "warn once per episode" without spamming. A simple approach is to call _last_probe_warning.pop("stats", None) on the success path of each probe.
  • Device probe ignores a non-200 response (system.py:~681). The stats and catalog probes now report a non-200 status, but /system-info returning 404 or 500 still blanks the GPU row with no warning. That is the exact symptom the PR targets.
                            status.detected_devices = detected
                        else:
                            _probe_failed(
                                status,
                                "devices",
                                "Could not read device info: Lemonade returned "
                                f"HTTP {sysinfo_resp.status_code}.",
                            )
    
  • Some config read errors now crash the status endpoint (src/gaia/config.py:196-204, exposed by system.py's narrowed except GaiaConfigError). read_text(encoding="utf-8") raises UnicodeDecodeError (a ValueError, not an OSError) on a non-UTF-8 file, so it escapes GaiaConfig.load. Before the narrowed catch, the status endpoint swallowed that; now /api/system/status returns a 500. The simplest fix is in the loader: except (OSError, UnicodeDecodeError) as e:.
  • Errors outside probe_errors now count as an outage. A supplementary probe that raises something outside (HTTPError, ValueError, TypeError, AttributeError), such as a KeyError from a future payload change, now falls through to the outer handler and reports lemonade_running=False with "Lemonade health query failed". I found no current code path that raises that today, so this is not blocking. It is a trade-off worth knowing about.

Strengths

  • _probe_failed gives each probe one consistent path for "record, warn once, then debug", and the tests cover every probe plus the repeat-logging behaviour.
  • Disk, config, store-close and reconcile errors now catch specific exception types instead of bare except Exception: pass, which follows the fail-loudly rule without changing whether the endpoint succeeds.
  • _register_agent_memory_ops now gates on isinstance(agent, MemoryMixin) and reads the methods directly, so a rename fails loudly. A test pins that behaviour by deleting the attribute.

Kalin Ovtcharov and others added 5 commits October 4, 2026 02:42
…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.
Each probe now clears its last-warning entry on success, so a failure that
returns after a healthy poll logs a warning instead of debug. A non-200 from
Lemonade's /system-info is reported in probe_warnings like the other probes.
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 4, 2026
Merged via the queue into amd:main with commit 787e57a Oct 4, 2026
@kovtcharov-amd
kovtcharov-amd deleted the kalin/ui-status-reports-probe-failures branch October 4, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents cli CLI changes dependencies Dependency updates llm LLM backend changes performance Performance-critical changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants