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

Method Init

internal/tui/model.go:359–373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

357 ok bool
358 baseURL string
359}
360
361// quitArmResetMsg fires ~3s after Ctrl+C arms the quit: if not already quit or
362// re-armed, clear the hint from the status bar.
363type quitArmResetMsg struct{}
364
365func (m Model) Init() tea.Cmd {
366 // Keyed (cloud) profiles get a silent Probe at startup so the status bar
367 // renders the live budget / context window from the first frame. Keyless
368 // (local Ollama) profiles get the cheaper Reachable ping: no headers to
369 // harvest, so a full probe would buy nothing.
370 connectivity := pingBackend(m.cli.BaseURL)
371 if p := m.cfg.ActiveProfile(); p != nil && p.ResolvedKey() != "" {
372 connectivity = probeBackend(m.cli, m.cfg.Active, true)
373 }
374 return tea.Batch(
375 textarea.Blink,
376 m.spinner.Tick,

Callers

nothing calls this directly

Calls 4

pingBackendFunction · 0.85
probeBackendFunction · 0.85
ActiveProfileMethod · 0.80
ResolvedKeyMethod · 0.80

Tested by

no test coverage detected