Skip to content

fix(ui): no Load button for a model Lemonade doesn't have - #7866

Merged
kovtcharov-amd merged 1 commit into
mainfrom
autofix/issue-7861
Nov 15, 2026
Merged

kovtcharov-amd merged 1 commit into
mainfrom
autofix/issue-7861

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

With a mistyped custom model ID, Settings › Advanced offered "Wrong model loaded. Load no-such-model-xyz-123", a Load button that can only fail. The fix the user needed, Custom model ID, sat closed below the fold. Now that banner only appears when Lemonade actually has the expected model. Custom model ID is also a jump target, so a failed-turn card can open Settings straight to it.

Refs #7861. The card's button is added in #7729, which still isn't merged. That PR needs to call jumpToSetting({ section: 'advanced', target: '[data-settings-target="custom-model"]' }) to close the issue.

Test plan

  • npx vitest run src/components/settings passes (276), including two new cases
  • npx tsc --noEmit is clean
  • In the Agent UI with a local model loaded, set Settings › Advanced › Custom model ID to no-such-model-xyz-123 and save. No "Wrong model loaded" banner or Load button appears, and the Model row still says Expected: no-such-model-xyz-123.
  • With a real downloaded model as the custom ID, the "Wrong model loaded" Load banner still appears
  • Check the Advanced pane in English and Arabic (npm run test:rtl)

⚠️ Needs manual validation: the automated checks here didn't run the Agent UI against a live Lemonade. Before merging, a maintainer should try the first two manual steps in the desktop app.

🔍 Technical details
  • wrongModel in AdvancedSettings.tsx now also requires status.model_downloaded !== false. When the expected model isn't loaded, the backend (routers/system.py around line 711) checks /models?show_all=true. An ID missing from the catalog comes back as model_downloaded = false, so a typo'd ID hides the banner. null (unknown) keeps today's behavior.
  • smallContext describes the loaded model, so it is left unchanged.
  • targetId="custom-model" is added to the Custom model ID SettingsDisclosure. SettingsDialog's jumpToSetting path then opens it, scrolls to it and focuses it, the same way model-server works.
  • The rtl.visual.ts jump check belongs with fix(ui): failed turn names the cause and offers Settings, not a command #7729, where the button that jumps lives.
  • python util/lint.py --all fails Import Validation and Bandit on main. This PR changes no Python. Python unit tests didn't collect on this runner because the responses dev dependency is missing.

Settings › Advanced offered "Wrong model loaded. [Load model]" for a
custom model ID that doesn't exist, a button that can only fail. The
banner now needs the expected model to be downloaded. Custom model ID
also gets a jump target so the failed-turn card can open Settings on it.

Refs #7861
@github-actions

Copy link
Copy Markdown
Contributor Author

Verdict: Approve with suggestions

Settings › Advanced no longer offers a Load button for a custom model ID that Lemonade doesn't have, such as a typo. The Custom model ID section is also now a place Settings can jump to. The typo fix is correct and tested.

One side effect is worth checking before merge. The server reports "not downloaded" for two different cases: a model ID Lemonade has never heard of, and a real model that just hasn't been pulled yet. The new rule hides the banner in both. So a user whose chosen model is real but not yet downloaded, with some other model loaded, now gets no action button at all: no Load, and no Download either, because the Download banner only appears when nothing is loaded. They still see "Expected: X" on the Model row. Before this change they had a Load button, so it's worth confirming whether that button used to fetch the model. If it did, this PR removes the only fix on that screen for them.

Real-world evidence

The evidence stage ran the server route behind this banner for real. The rendered Settings screen is pending the strix-halo lane.

--- GET /api/system/status
{"lemonade_running":false,"lemonade_error":null,"lemonade_probe":"down","model_loaded":null,"embedding_model_loaded":false,...,"context_size_sufficient":true,"model_downloaded":null,"default_model_name":"Gemma-4-E4B-it-GGUF","default_model_is_cloud":false,...,"expected_model_loaded":true,...}
HTTP 200 in 0.016592s
  • Every field the new rule reads is present. model_downloaded: null (unchecked) keeps today's behaviour, so the Load button still shows when the server hasn't checked.
  • Lemonade wasn't running here, so the typo state (model loaded, expected model missing) was covered only by the new component test.
  • Spot checks on sibling routes all returned 200 as expected: /api/health, /api/settings, /api/system/model-server (reachable:false with an actionable error) and /api/system/warm-up.

The verdict rests on this route evidence plus static review. The before/after screenshot of the Advanced pane is still owed by the strix-halo lane.

🔍 Technical details

🟡 A real but undownloaded expected model loses its action (AdvancedSettings.tsx:162-164)

In routers/system.py:736-751, model_downloaded is False both when the catalog entry has downloaded: false and when the ID isn't in the catalog at all ("Model not found in catalog → treat as not downloaded"). The new status.model_downloaded !== false guard on wrongModel therefore also hides the banner when the custom/default model is a valid catalog entry that hasn't been pulled. notDownloaded requires !status.model_loaded, so it doesn't pick that case up. The result is a state with no action row.

Options:

  • Let the Download row cover the "other model loaded" case too: drop !status.model_loaded from notDownloaded. downloadModel is already called with loadAfter = !status.model_loaded. A typo'd ID would then get a Download that fails with a named error (ErrorNotice), which is honest. Add a test for that state.
  • Or have the backend tell the two cases apart (for example a model_in_catalog field) and gate on that instead. This is the cleaner long-term fix.

Whichever you choose, add a component test for "model loaded, expected model in the catalog but not downloaded" so the intended behaviour is pinned.

Checks run

  • Sibling paths: under the 200-line threshold. The banner logic lives only in AdvancedSettings.tsx.
  • Known bug classes: the "dishonest status" class is the one that applies, and it is the finding above.
  • Doc drift: no doc under docs/ or hub/ describes the "Wrong model loaded" banner.

Strengths

  • The fix is one condition and keeps null (unchecked) on today's path, so a failed catalog probe doesn't hide the banner.
  • targetId="custom-model" reuses the existing jumpToSetting mechanism (same as model-server) instead of adding a new one, and a test pins the target.

@kovtcharov-amd
kovtcharov-amd marked this pull request as draft November 13, 2026 04:43
@kovtcharov-amd kovtcharov-amd self-assigned this Nov 13, 2026
@kovtcharov-amd
kovtcharov-amd marked this pull request as ready for review November 14, 2026 07:49
@github-actions

Copy link
Copy Markdown
Contributor Author

Skill audit

Skill Verdict Claimed tier Cleared tiers Findings Rules
hub/agents/gaia/npm ✅ ALLOW experimental experimental 3 high body.injection.credential_request, body.injection.guardrail_bypass, body.injection.persona_override
hub/skills/automations ✅ ALLOW community experimental, community 1 info permission.unused
hub/skills/calendar ✅ ALLOW community experimental, community none —
hub/skills/price-watch ✅ ALLOW community experimental, community 1 info permission.unused
hub/skills/send-email ✅ ALLOW community experimental, community none —

✅ All audited skills cleared the tier they claim.

Per-finding detail is withheld here on purpose. Read it in the Security > Code scanning tab, or download the skill-audit-reports artifact from this run. Offending source text is withheld from CI everywhere — reproduce it locally with gaia skill audit <dir> --show-snippets.

@github-actions

Copy link
Copy Markdown
Contributor Author

Verdict: Approve with suggestions

With a mistyped custom model ID, Settings › Advanced used to show a Load button that could only fail. This PR hides it, and lets Settings jump straight to the Custom model ID field. The change is small and tested, and fixes the reported case.

One gap to fix here or file: the new check can't tell "this ID doesn't exist" apart from "this is a real model that isn't downloaded yet". The server marks both as not downloaded. So if you pick a real model you haven't downloaded while another one is loaded, Settings now shows only "Expected: X", with no Load or Download button. Before this PR it offered Load. A small server-side "found in catalog" flag would let the screen hide Load for a typo and still offer Download for a real model.

Real-world evidence

The evidence stage exercised the HTTP routes behind this screen. Lemonade wasn't running, and the rendered Settings screen is pending strix-halo lane.

$ curl -s http://127.0.0.1:4200/api/system/status
{ "lemonade_running": false, "model_loaded": null, "expected_model_loaded": true,
  "model_downloaded": null, "default_model_name": "Gemma-4-E4B-it-GGUF", ... }

$ curl -s -X PUT -H 'X-Gaia-UI: 1' -H 'Content-Type: application/json' \
       -d '{"custom_model":"no-such-model-xyz-123"}' http://127.0.0.1:4200/api/settings
{"custom_model":"no-such-model-xyz-123","model_status":{"found":false,"downloaded":false,"loaded":false,"checked":false},...}
HTTP 200
  • The route returns the fields the new check reads. With Lemonade unreachable, model_downloaded stays null, which leaves today's behaviour unchanged.
  • The exact state this PR targets needs a live Lemonade with a different model loaded. It is covered only by the component test, so that part of the verdict rests on static review.
  • Spot checks of the sibling routes (/api/settings, /api/system/model-server, /api/system/warm-up) all returned 200 with the expected shapes.
  • The PR's two manual steps (a typo'd ID, and a real downloaded ID that still shows the banner) are still unchecked. Run them in the desktop app before merge, as the PR asks.
🔍 Technical details

🟡 A real model that isn't downloaded loses its action when another model is loaded (AdvancedSettings.tsx:162)

routers/system.py:738-751 sets model_downloaded = False in two cases: when the catalog entry has downloaded: false, and when the ID is missing from the catalog. The new guard status.model_downloaded !== false therefore also turns wrongModel off for a valid catalog model that just isn't pulled. notDownloaded (line 164) still requires !status.model_loaded, so with Gemma loaded and default_model or the custom ID set to an unpulled built-in, neither row renders. Only the "Expected: X" hint is left.

Suggested fix: have the status route report whether the ID was found in the catalog (/api/settings already computes model_status.found). Then:

  • found and not downloaded, with a model loaded → show the Download row (drop the !status.model_loaded requirement for that case)
  • not found → no Load and no Download; point the user to Custom model ID

If that's out of scope, add a test that pins the found-but-not-downloaded case, and file it as Follow-up: Settings › Advanced offers no Download for an unpulled expected model while another is loaded.

Checks run

  • Known bug classes: this is a pure render condition with no waits, shared state or startup path. Under "Dishonest status", the Model row still marks the state not-ok and names the expected model, so nothing reports success falsely.
  • Doc drift: no doc under docs/ or hub/skills/ describes the "Wrong model loaded" banner or its Load button.
  • Sibling paths: under 200 changed lines, so not required. targetId follows the existing model-server pattern (AdvancedSettings.tsx:313, SettingsDisclosure.tsx:29).

Strengths

  • Narrow fix that leaves null (unknown) on today's behaviour, so an unreachable catalog can't hide a valid Load.
  • Both new behaviours have component tests, and the jump target reuses the existing data-settings-target mechanism instead of a new one.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit cba2e41 Nov 15, 2026
249 of 285 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the autofix/issue-7861 branch November 15, 2026 16:22
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Nov 15, 2026
…nd (amd#7729)

A turn that failed on a mistyped Custom model ID showed "Something went
wrong", the raw model-server error, and a line telling a desktop user to
run a terminal command and "re-run your GAIA command". The card is now
headed with the cause ("This model isn't available"), says what to do in
plain words, offers a button for each Settings tab the fix lives on, and
keeps the server's own words under a closed Details. "Open Settings ›
Advanced" opens Custom model ID itself, focused, rather than the top of
the tab (the target amd#7866 added). Wording sent to the app no longer
carries the terminal remedies: the restart line of a failed model load,
the client pull command for a model that isn't downloaded, and the start
command for GAIA's own model server.

Closes amd#7705
Closes amd#7861
Refs amd#7364

Error classification gains one case (a model name the server doesn't
list), which only affects a turn that fails before it starts; no eval
category should move, and `tool_calling` and `rag_quality` are the ones
to watch on the next RC.

## Test plan
- [x] `npx vitest run
src/components/__tests__/MessageBubble.failedTurn.test.tsx
src/components/__tests__/uxFixes.test.tsx src/i18n
src/components/settings src/stores` (new: the Advanced button lands on
Custom model ID with no way "back")
- [x] `npx tsc --noEmit -p .`
- [x] `npm run test:rtl -- -g "failed turn"`, screenshots read in
English and Arabic, Details closed and open, and the new scene from the
card's Advanced button to an opened, focused Custom model ID
- [x] `pytest tests/unit/test_app_errors_name_no_command.py
tests/unit/test_provider_error_surface_advice.py
tests/unit/test_lemonade_error_classification.py
hub/agents/gaia/python/tests/test_server_query.py`
- [ ] Looked at in the packaged app

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-ui Agent UI changes bug Something isn't working p3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant