Repository navigation
fix(tui): check a cloud default model as cloud after Lemonade restarts - #5992
Conversation
With an AMD LLM Gateway model saved as default_model, a TUI launch after Lemonade restarted offered the gateway model as a ~4 GB download, and re-check never cleared it. The launch passes no model, so the gate only looked for a cloud model in the launch's own model and fell through to the local download check for the sidecar's (cloud) default. The gate now treats a cloud sidecar default as cloud, so it hands Lemonade the kept gateway key and confirms the model is listed. Closes #5989
Covers the states around the fix: no kept key, a failed key replay and a model the gateway does not list all ask for the provider instead of offering a download; a launch's own cloud model outranks the saved default; and a local model whose name only starts with amd or fireworks keeps its download gate.
|
Verdict: Approve with suggestions This fixes a launch-check bug for people who saved an AMD LLM Gateway model as their default. After Lemonade restarted, the TUI showed that model as a ~4 GB download it couldn't fetch, and re-check never cleared it. The check now recognises a cloud default as a cloud model, gives the restarted Lemonade the saved key back, and confirms the model is listed. The fix is narrow and correct, local defaults keep their download check, and the new test reproduces the issue's exact row. Only a one-line comment tweak is suggested. Real-world evidenceN/A: no evidence bundle was produced for this PR. The change is TUI preflight logic, and its real surface needs a saved gateway key and a stopped Lemonade, which this runner doesn't have. The verdict rests on static review plus 🔍 Technical detailsIssues found 🟢 Stale lead comment ( Checked, no issue
Strengths
|
|
I checked this against the issue's exact state: on main, a gateway default with a keyless Lemonade shows the "About 4 GB" download row, and with this fix the saved key is handed back and the row goes green. The key never reaches the TUI. The daemon reads it from the credential store and replies with only I added tests that try to break it, and they pass. When there's no kept key, the replay fails, or the gateway doesn't list the model, the row asks you to connect the provider and never offers a download. A cloud model passed at launch still wins over the saved default. A local model whose name merely starts with One gap I left out of this PR: if the saved default is a gateway model and you launch on a picked local model, the gate still reports the gateway model as "not downloaded, About 4 GB". That's a different launch setup from #5989, so it belongs in a follow-up. 🔍 Technical details
|
|
Verdict: Approve When an AMD LLM Gateway model is saved as the default, the TUI's launch check now treats it as a cloud model. It no longer offers it as a "~4 GB download" after Lemonade restarts. The fix is small and targeted: a model passed for this launch still wins, and only a real provider-prefixed id counts as cloud. The new tests cover each of those cases, plus the three ways a cloud default can fail to connect. I found no blocking issues. Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on static review and the package's Go tests, which I re-ran here and which pass ( 🔍 Technical detailsIssues found 🟢 A local model passed at launch, with a cloud default, still gets a download row ( Strengths
|
…del (amd#6017) With an AMD LLM Gateway model saved as the default, launching the TUI on a picked local model listed the gateway model as "not downloaded — About 4 GB" and blocked the launch on a download it would never use. Now the model row checks the local model you picked: it goes green when that model is on disk, and if it isn't, the row names that model, not the cloud one. This is the local-launch half of amd#5992, which covers launching on the gateway model itself. Closes amd#6016 ## Test plan - [x] `cd tui && go test ./internal/ui/...` passes, including a new test that reproduces the issue's exact "amd.… not downloaded — About 4 GB" row without the fix - [ ] `python util/lint.py --all` passes in CI (here GAIA wasn't installed, so the two checks that import it failed for that reason) - [ ] Manual: set an `amd.*` gateway model as `default_model`, launch `gaia-tui` on a downloaded local model (e.g. Gemma-4-E4B). The model row should read "downloaded — chat uses Gemma-4-E4B-it-GGUF", with no download offer >⚠️ **Needs manual validation:** the automated checks cover the gate's logic with a stubbed daemon and Lemonade. Before merging, a maintainer should run the manual step above on a machine with a saved gateway key. <details> <summary>🔍 Technical details</summary> - Root cause: the daemon-path model row in `probeInit` (`tui/internal/ui/preflight/check.go`) reads `body.Model` from the sidecar's `/init`, which names the saved `default_model`. With a cloud default and a local `cfg.Model`, that cloud id came back `present:false`, so the row fell through to the local `FixPullModel` / "About 4 GB" branch. - Fix: when `cfg.Model` is a local pick and the sidecar's model is a cloud id, the row comes from `checkLocalModelDownloaded`, the existing on-disk check pulled out of `localRunner.checkPickedModel` in `local.go`. - Scoped to a cloud sidecar model, so a local default under a local pick behaves as before (context-window reporting included). - Touches the same block as amd#5992, so whichever merges second needs a small rebase. The two changes don't overlap in logic: amd#5992 handles an empty `cfg.Model`, this one a local `cfg.Model`. - New test: `TestDaemonGateChecksThePickedLocalModelOverACloudDefault` in `cloud_daemon_test.go` covers both the downloaded and the missing pick. </details> --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Kalin Ovtcharov <[email protected]>
With an AMD LLM Gateway model saved as the default, launching the TUI after Lemonade had stopped showed the gateway model as "not downloaded — About 4 GB · f download it now", and re-check never cleared it. The launch check only recognised a cloud model when one was passed for this launch, so a cloud default fell into the local-download check. Now it is checked as a cloud model: the TUI hands the restarted Lemonade the saved gateway key, confirms the model is listed, and never describes it as a download.
Closes #5989
Test plan
cd tui && go test ./internal/ui/...passes, including a new test that reproduces the issue's exact "About 4 GB" row without the fixpython util/lint.py --allpasses in CI (here only the two checks that need GAIA installed failed, on environment)amd.*gateway model asdefault_model, stop Lemonade, launchgaia-tui. The model row should go green ("chat uses amd.…") with no download offer and no need to pressp🔍 Technical details
tui/internal/ui/preflight/check.go, AI model section) branched tocheckCloudModelonly whencfg.Modelwas a cloud id. With a saveddefault_modelthe launch passes no model, the sidecar's/initreportsamd.DeepSeek-V4.1-Flashwithpresent:false(keyless Lemonade lists noamd.*), and the row fell through to the localFixPullModel/ "About 4 GB" path.cfg.Modelis empty and the sidecar's model id is a cloud id, use that id for the cloud check. The cloud check already replays the kept key through the daemon (replayKeptKey) before it calls the provider disconnected.Config.runsInCloudfromlocal.go, since it no longer has callers.TestDaemonGateTreatsACloudDefaultModelAsCloudincloud_daemon_test.go. The existingTestDaemonGateStillRequiresTheLocalModelForALocalLaunchstill confirms that a local default keeps its download gate.