rebuildClient swaps in a fresh llm.Client for the now-active profile. Replacing the pointer (not mutating fields) drops the prior Client's sticky state (noReasoningEffort, keep-alive pool tied to the old URL): new endpoint, fresh slate.
()
| 185 | // rebuildClient swaps in a fresh llm.Client for the now-active profile. |
| 186 | // Replacing the pointer (not mutating fields) drops the prior Client's sticky |
| 187 | // state (noReasoningEffort, keep-alive pool tied to the old URL): new |
| 188 | // endpoint, fresh slate. |
| 189 | func (m *Model) rebuildClient() { |
| 190 | p := m.cfg.ActiveProfile() |
| 191 | m.cli = llm.New(m.cfg.ActiveURL(), p.LLM, p.ResolvedKey()) |
| 192 | // Drop the prior profile's cached BudgetStatus. m.budget has no profile |
| 193 | // association, so without this reset the footer keeps rendering the old |
| 194 | // "88% pass" segment after switching to a local profile that emits no |
| 195 | // X-Budget-* headers (nothing would overwrite it). A fresh BudgetStatus{} |
| 196 | // hides the segment until the new backend reports its own. |
| 197 | m.budget = cloud.BudgetStatus{} |
| 198 | } |
| 199 |
no test coverage detected