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)
| 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. |
| 273 | type 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 |