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

Method Probe

internal/llm/llm.go:264–278  ·  view source on GitHub ↗

Probe sends a minimal hello chat just to harvest response headers in one round trip: status validates the URL/model/key combo, X-Context-Window gives the live size, X-Budget-Remaining the live fraction. The body is closed unread; on the cloud proxy that may already charge one token, the cost of a si

(parent context.Context)

Source from the content-addressed store, hash-verified

262 Token: token,
263 HTTP: &http.Client{},
264 IdleTimeout: idleTimeoutFromEnv(),
265 RetryBackoff: defaultRetryBackoff,
266 }
267}
268
269// ProbeResult holds what Probe extracts from a one-shot hello request: the
270// live context window and budget snapshot. The TUI shows the real window at
271// activation time and feeds the authoritative size to ctx.Pack instead of the
272// config.yaml fallback.
273type ProbeResult struct {
274 ContextWindow int
275 Budget cloud.BudgetStatus
276}
277
278// Probe sends a minimal hello chat just to harvest response headers in one
279// round trip: status validates the URL/model/key combo, X-Context-Window gives
280// the live size, X-Budget-Remaining the live fraction. The body is closed
281// unread; on the cloud proxy that may already charge one token, the cost of a

Callers 2

probeBackendFunction · 0.80

Calls 3

postChatMethod · 0.95
ContextWindowFromHeadersFunction · 0.92
FromHeadersFunction · 0.92

Tested by 1