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

Function probeBackend

internal/tui/probe.go:34–47  ·  view source on GitHub ↗

probeBackend wraps llm.Client.Probe in a tea.Cmd, bounded by probeTimeout so a hung backend never freezes activation. silent=true (startup probe) skips the "✓ active" banner, just seeding live budget/ctx values.

(cli *llm.Client, profileName string, silent bool)

Source from the content-addressed store, hash-verified

32 silent bool // suppress the "✓ active" line; startup probe only
33 err error
34}
35
36// probeBackend wraps llm.Client.Probe in a tea.Cmd, bounded by probeTimeout so
37// a hung backend never freezes activation. silent=true (startup probe) skips
38// the "✓ active" banner, just seeding live budget/ctx values.
39func probeBackend(cli *llm.Client, profileName string, silent bool) tea.Cmd {
40 return func() tea.Msg {
41 ctx, cancel := context.WithTimeout(context.Background(), probeTimeout)
42 defer cancel()
43 res, err := cli.Probe(ctx)
44 return probeMsg{
45 profile: profileName,
46 cli: cli,
47 contextWindow: res.ContextWindow,
48 budget: res.Budget,
49 silent: silent,
50 err: err,

Callers 2

InitMethod · 0.85
confirmActiveMethod · 0.85

Calls 1

ProbeMethod · 0.80

Tested by

no test coverage detected