MCPcopy Index your code
hub / github.com/codehamr/codehamr / confirmActive

Method confirmActive

internal/tui/slash.go:173–181  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

171// X-Context-Window. Keyless profiles (local Ollama) ping and print
172// synchronously. Shared by /models and /hamrpass.
173func (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

Callers 2

cmdModelMethod · 0.95
activateHamrpassMethod · 0.95

Calls 5

appendLineMethod · 0.95
probeBackendFunction · 0.85
pingBackendFunction · 0.85
ActiveProfileMethod · 0.80
ResolvedKeyMethod · 0.80

Tested by

no test coverage detected