New builds a Client governed by the caller's context, not http.Client.Timeout. That timeout is end-to-end (it covers body reads) and would kill a slow but legitimate SSE stream mid-flight on slow local backends. tui.Model's turnCtx is the single cancellation source; connect-level safety (DNS/TCP) is
(base, model, token string)
| 236 | // legitimate SSE stream mid-flight on slow local backends. tui.Model's turnCtx |
| 237 | // is the single cancellation source; connect-level safety (DNS/TCP) is already |
| 238 | // bounded by Go's default Dialer (30s). |
| 239 | func New(base, model, token string) *Client { |
| 240 | return &Client{ |
| 241 | BaseURL: strings.TrimRight(base, "/"), |
| 242 | Model: model, |
| 243 | Token: token, |
| 244 | HTTP: &http.Client{}, |
| 245 | IdleTimeout: idleTimeoutFromEnv(), |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | // ProbeResult holds what Probe extracts from a one-shot hello request: the |