Repository navigation
fix(ui): Model server panel names the model GAIA chats with - #7646
Conversation
Settings > Advanced showed the server's last-used model as GAIA's chat model, so a cloud model another app used could read as "Runs on: Remote (cloud)" while chats ran locally. It now names GAIA's own chat model (or none while it isn't loaded) and lists other loaded models, cloud ones marked Remote, on their own rows. Closes amd#7593
|
Verdict: Approve with suggestions This fixes the Settings › Advanced "Model server" panel. On a server shared with other apps, it named whichever model was used last, so it could call a cloud model GAIA's chat model when chats were really answered locally. Now the panel names the model GAIA chats with: your override, or else the configured default. Every other loaded model, cloud ones included, gets its own row marked as such. The fix is small and covered by tests that fail on main, and the before/after screenshots show the right result.
Real-world evidenceN/A: no evidence bundle was produced for this run. The PR description embeds before/after screenshots of the real panel against a real Lemonade with Gemma 4 E4B and a cloud model both loaded. Those screenshots show the fix working. The "None loaded" state is covered only by a unit test, and its manual test-plan item is still unchecked. Beyond the screenshots, this verdict rests on static review. 🔍 Technical details🟡 Follow-up: TUI status line uses last-used model ( 🟢 Cloud chat model not on the server reads "None loaded" ( 🟢 Duplicate prefix normalizer ( Strengths
|
…ade (amd#8224) ## Summary The TUI status line (`gaia-tui status`, the Local row in the model picker) now names the model GAIA chats with, not whichever model Lemonade loaded last, on a Lemonade shared with other apps. ## Why `describeServer` in `tui/internal/lemonade/serverinfo.go` took the chat model from `/health`'s `model_loaded`, else the first loaded chat model. On a shared server that is often another app's model, for example a cloud model it just used, so the status line said GAIA was chatting with it while GAIA actually chats with its local Gemma. amd#7646 fixed the same mistake in the Agent UI's Settings > Advanced > Model server panel (`model_server_info._chat_entry`); the TUI computes the chat model on its own and still had it. ## Linked issue Closes amd#7714 ## Changes - **`GaiaChatModel()`** resolves the model GAIA chats with, as `resolve_chat_model` does: config.json's `last_model` (the user's last pick in the TUI or Agent UI), else `default_model`, else `Gemma-4-E4B-it-GGUF`. A `hybrid` choice resolves to its cheap model, the one a session starts on (`start_model`). It returns `""` if config.json can't be read. - **`describeServer(..., chatModel)`**: with a chat model, `Chat` is only that model, compared ignoring the `user.` prefix and case (`SameLocalID`, as `_model_key`). Without one, behavior is as before. `ServerInfo` passes `GaiaChatModel()`. - When GAIA's local model isn't loaded, the line says `· <model> not loaded` instead of naming another app's model, and the Local row doesn't borrow another app's local model either. A local model beside a cloud chat model is still shown there, as before. - One existing test fixture (`TestServerInfoSurvivesAMissingSystemInfo`) loaded a model called `M`, which is no longer GAIA's chat model with no config. It now loads Gemma; the test still checks the missing `/system-info` case it was written for. ## Test plan - [x] New in `serverinfo_test.go`, all against a fake shared Lemonade whose `model_loaded` is another app's cloud model: - `TestASharedServersLastModelIsNotGaiasChatModel` (no config: GAIA's default Gemma). - `TestTheChatModelFollowsConfigIgnoringTheUserPrefix` (`default_model`; `last_model` as `user.X` wins; `hybrid` uses its cheap model). - `TestGaiasChatModelNotLoadedIsSaidNotReplaced`. - `TestAnUnreadableConfigNamesNoChatModel`. - [x] The three shared-server tests fail against `main`: each one names `fireworks.kimi-k2p7` as the chat model. They pass here. - [x] `go test ./...` in `tui/` (Go 1.27): all packages pass. `go vet ./...` and `gofmt -l .` are clean. - [x] `python util/lint.py --all`: all checks passed. ## Evidence `ServerInfo(...).StatusLine()` against a Lemonade with another app's cloud model loaded last and GAIA's Gemma beside it, with no GAIA config (so GAIA chats with its default Gemma): ``` ===== main ===== Lemonade 10.8.1 (yours) at localhost:13305 · fireworks.kimi-k2p7 (cloud, runs remotely) ===== this PR ===== Lemonade 10.8.1 (yours) at localhost:13305 · Gemma-4-E4B-it-GGUF on Vulkan, 64K ctx ``` - [x] **Agent exposed in the Agent UI**: N/A, TUI only. The Agent UI panel was fixed in amd#7646. - [x] **MCP tools / servers**: N/A. - [x] **CLI**: `gaia-tui status` prints this line (`printModelServer`); shown above. - [x] **HTTP API / REST**: N/A. ## Checklist - [x] I have linked a GitHub issue above (`Closes #N` / `Fixes #N` / `Refs #N`). - [x] I have described **why** this change is being made, not just what changed. - [x] I have run linting and tests locally (`python util/lint.py --all`, and `go test ./...` / `go vet ./...` in `tui/`). - [x] I have attached **real-world evidence matched to the surface I changed** (see Evidence above), or marked each surface N/A. - [x] I have updated documentation if user-visible behavior changed: the status line text explains itself; no doc page quotes it.
Settings > Advanced could tell a user their chat model was a cloud model running remotely, while every chat was answered on their own PC. The panel showed whichever model the model server used last, even when another app loaded it. Now "Chat model" names the model GAIA chats with, and any other loaded model, cloud ones included, gets its own row marked as such.
Closes #7593
Test plan
pytest tests/unit/test_model_server_info.py tests/unit/test_users_lemonade_untouched.py tests/unit/test_lemonade_server_down.py tests/unit/test_lemonade_load_error_not_network.py, including 4 new tests that fail on main🔍 Technical details
model_server_info._chat_entrynow takes the model GAIA chats with (the user'scustom_modelsetting, elseresolve_default_chat_model()) and matches it ignoring theuser.prefix. The two/model-serverendpoints inrouters/system.pypass it in.test_users_lemonade_untouched.pybuilds a bare app, so it now supplies the database dependency the endpoint needs.