TestProbeBudgetExhaustedUpdatesStatusBar: a 402 probe carries a BudgetStatus{Set:true, Remaining:0} snapshot. handleProbe must apply it to m.budget so the bar paints "0% pass" now, not after the first chat call 402s.
(t *testing.T)
| 1299 | // TestStaleProbeForSameProfileDoesNotOverwriteFreshOutcome: two probes for the |
| 1300 | // SAME profile can be in flight (startup probe + a re-activation); the profile |
| 1301 | // name alone can't tell them apart, so staleness is keyed on the client |
| 1302 | // pointer (rebuildClient swaps it per re-activation). A hung old probe's |
| 1303 | // failure landing after the fresh probe's success must neither flip connected |
| 1304 | // nor print a contradictory "⚠ probe" banner after the "✓ active" line. |
| 1305 | func TestStaleProbeForSameProfileDoesNotOverwriteFreshOutcome(t *testing.T) { |
| 1306 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 1307 | m.cfg.Active = "local" |
| 1308 | staleCli := m.cli |
| 1309 | m.rebuildClient() // re-activation swapped the client; staleCli's probe is now superseded |
| 1310 | m.connected = true |
| 1311 | |
| 1312 | out, _ := m.handleProbe(probeMsg{profile: "local", cli: staleCli, err: cloud.ErrUnauthorized}) |
| 1313 | final := out.(Model) |
| 1314 | if !final.connected { |
| 1315 | t.Fatal("stale same-profile probe failure must not flip connected") |
| 1316 | } |
| 1317 | if got := stripANSI(final.scroll.String()); strings.Contains(got, "⚠ probe") { |
| 1318 | t.Fatalf("stale same-profile probe must not print a failure banner:\n%s", got) |
| 1319 | } |
| 1320 | } |
nothing calls this directly
no test coverage detected