confirmActive emits the activation line for the active profile and returns its reachability cmd. Keyed profiles (cloud) probe: the success line is delayed until the response arrives so it can carry the live ctx window from X-Context-Window. Keyless profiles (local Ollama) ping and print synchronousl
(profile string)
| 171 | // X-Context-Window. Keyless profiles (local Ollama) ping and print |
| 172 | // synchronously. Shared by /models and /hamrpass. |
| 173 | func (m *Model) confirmActive(profile string) tea.Cmd { |
| 174 | p := m.cfg.ActiveProfile() |
| 175 | // ActiveURL, not p.URL: under a CODEHAMR_URL override the banner must name |
| 176 | // the endpoint actually dialed, not the config value the override displaced. |
| 177 | if p.ResolvedKey() != "" { |
| 178 | m.appendLine(styleDim.Render(fmt.Sprintf("▶ probing %s · %s @ %s", profile, p.LLM, m.cfg.ActiveURL()))) |
| 179 | return probeBackend(m.cli, profile, false) |
| 180 | } |
| 181 | m.appendLine(styleOK.Render(fmt.Sprintf("✓ active: %s · %s @ %s", profile, p.LLM, m.cfg.ActiveURL()))) |
| 182 | return pingBackend(m.cli.BaseURL) |
| 183 | } |
| 184 |
no test coverage detected