Repository navigation
feat(tui): ask where chat runs before the first-run model download - #5109
Conversation
…download A first-time user pressing Enter through setup downloaded ~6 GB of local models without ever seeing that Fireworks AI or the AMD LLM Gateway were an option; the choice was only behind the `p` footer key. The first-run gate now opens on "where should chat run?" (step 1 of 3): Local, with its download size and whether it fits this PC once Lemonade can say, then Fireworks AI and AMD LLM Gateway, each with one line on privacy, cost and speed. Lemonade is installed next either way. Local then downloads the models as before; a cloud choice opens that provider's key form and downloads only the embedding model. A saved choice, --model, --use-claude, and headless runs skip the question, and `p` keeps working.
|
Verdict: Approve with suggestions New users now get asked where chat should run (Local, Fireworks AI or AMD LLM Gateway) before setup downloads anything. Before this, pressing Enter through setup quietly downloaded ~6 GB of local models. I found no correctness problems. The new step is skipped whenever the answer is already known: a saved model, One thing before merge: the only run of the new screen is the golden test. Nobody has run it on a real machine yet. Both clean-machine items in the test plan are unchecked, and so is the Real-world evidenceN/A: no evidence bundle was produced for this run. That stage didn't drive the terminal UI, so the verdict rests on static review. I also built the module and ran the PR's Go test packages on this runner, and they pass: The screen in the PR description comes from the golden test, not a live session. A 🔍 Technical detailsIssues 🟡 No live run of the first-run flow (PR test plan). The handoff from the connect step to the provider panel and back to a rebuilt gate is covered by stubs only:
🟢 There's no way back to the question after choosing a cloud provider without connecting it. The session-scoped 🟢 The footer hardcodes the flagship id ( Verified
Strengths
|
Covers the question at 20x6, 12x4, 1x1 and 0x0, resizing while it is up, a PC whose memory cannot be measured, an unknown provider, a re-check that lands mid-choice (Lemonade failing, the chat row gone, fewer options than the cursor), 6000 random keypresses, and enter mashed after a choice.
…the scripted runner's Fix Kept both sets of fix kinds and provider fields. Key mashing in the adversarial test started a fix while an earlier fix goroutine was still recording, which the race detector flagged in the test double. The local option's memory need now reads ~5 GB, from main's model sizes.
# Conflicts: # tui/internal/ui/providers/model.go
A new user pressing Enter through first-run setup downloaded ~6 GB of local models without ever seeing that Fireworks AI or the AMD LLM Gateway were options; the choice was only reachable with the
pfooter key. Setup now opens by asking where chat should run, before anything downloads. Each option gets one plain line on privacy, cost and speed, and Local shows its download size and, once Lemonade can measure the PC, whether the model fits. A cloud choice still installs Lemonade (it routes the requests and runs the embeddings), then opens that provider's key form and downloads only the embedding model.A saved model,
--model,--use-claudeand headless--queryruns skip the question, andpstill opens the full provider panel. UI-only: no agent prompt, tool, or model-selection code changed, so no eval run is needed.Fixes #5082
Refs #5087
Test plan
cd tui && go test ./internal/ui/preflight/ ./internal/ui/providers/ ./internal/ui/root/ ./internal/lemonade/. New tests cover step order for a new machine, Local, Fireworks and AMD, the skip cases, the fit line, a golden of the screen above, small terminals, keys, and the host hand-offs.tui/testintegration package (not run locally; it builds the mock agent binary).~/.gaia):gaia tuiopens on the question. Choose Fireworks AI, press Enter to install Lemonade, then Enter opens the key form. After you pick a model, the last step reads "download the embedding model (under 1 GB)".Adversarial tests
internal/ui/preflight/chat_adversarial_test.go(10 tests) attacks the first-run choice with:None of them found a bug. The cursor clamp on a shorter option list is what stops an index-out-of-range panic; removing it makes the shorter-list test fail.