Repository navigation
fix(tui): stop the AI provider screen reporting faults that aren't there - #4505
Conversation
On a new machine, opening the provider picker before setup installed Lemonade said "Lemonade did not respond", a fault for a step the user had not reached. It now names the setup step that installs Lemonade and waits for it. A Fireworks key Lemonade already held (LEMONADE_FIREWORKS_API_KEY) still showed "Paste API key", because Lemonade reports a provider's key only once the provider is registered. Opening Fireworks setup now registers it (no key sent), restores any kept key, and says "A key is already set — Enter connects". The setup text no longer claims keys are lost when Lemonade restarts. Closes amd#4503
|
Verdict: Approve with suggestions The AI provider screen stops showing faults that aren't real. On a new machine it names the setup step that installs Lemonade, where before it said "Lemonade did not respond". A Fireworks key that Lemonade already holds now shows as set, not "Paste API key". The setup text now says pasted keys go to the OS credential store, not that they're lost on restart. The logic is sound and well tested, and a real unreachable Lemonade after setup still reports the fault. Nothing blocks the merge. Two small things worth knowing:
Real-world evidenceN/A — no evidence bundle for this run; the change is a Go TUI surface. The PR description reports two manual runs driven over the TUI control API: a fresh Apart from those tests, the verdict rests on static review; I did not drive the TUI myself. 🔍 Technical detailsIssues found 🟢 Opening setup writes to a shared server ( 🟢 Possible stale-read race ( 🟢 Restore result discarded ( Checked and fine
Strengths
|
A provider read sent when the panel opened could land after the read that followed registering Fireworks, putting "Paste API key" back for a key Lemonade holds. Each read now carries when it was sent, and an older one is dropped.
Three things on the AI provider screen told users something untrue. On a new machine, pressing p before setup installed Lemonade showed "Lemonade did not respond… Start it", a fault for a step they hadn't reached. A Fireworks key Lemonade already held (
LEMONADE_FIREWORKS_API_KEY) still showed "Paste API key", though Enter connected. And the setup text said keys are lost when Lemonade restarts, which stopped being true with #4485. Now the picker names the setup step that installs Lemonade and waits for it, the key field says "A key is already set — Enter connects", and the text says the key is kept in the OS credential store.Past setup, an unreachable Lemonade still reports the fault as before.
Closes #4503
🔍 Technical details
/system-info, and so reportsenv_var_set, only afterPOST /installregisters it. That's why the env key was invisible. Opening Fireworks setup now registers it with the same fixed settings Connect sends (no key), re-runs the kept-key restore, then re-reads providers. I confirmed this against a reallemond2026.39.1:providers: []before,env_var_set: trueafter.lemonade.ErrUnreachableis now a sentinel. Root passesReport.LemonadeStep()into the panel viaWithSetupStep, so the wording follows the real step number.tui/README.mdanddocs/guides/ai-providers.mdxare updated to match.Test plan
cd tui && go build ./... && go vet ./... && go test ./...— all pass;gofmt -lclean after CRLF striptui/internal/ui/providers/setup_state_test.go: step message before setup, fault after setup, "A key is already set" against a fake Lemonade that lists Fireworks only once registered, credential-store wording at both panel heightsGAIA_HOMEfirst run, driven over the control API, p on the setup gate: before shows "Lemonade did not respond"; after shows "Lemonade isn't installed yet — setup step 1 installs it" and Enter does nothinglemondstarted withLEMONADE_FIREWORKS_API_KEY,/provider→ Fireworks: before shows "Paste API key" plus "Keys stay in Lemonade memory until it restarts"; after shows "A key is already set — Enter connects" plus the credential-store line