MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestNewHasNoHTTPTimeout

Function TestNewHasNoHTTPTimeout

internal/llm/llm_test.go:819–824  ·  view source on GitHub ↗

TestNewHasNoHTTPTimeout pins that the streaming Client must NOT set http.Client.Timeout: that field is end-to-end (it covers body reads) and would abort a legitimately slow SSE stream with "context deadline exceeded … while reading body" on slow local backends. Per-turn context cancellation governs

(t *testing.T)

Source from the content-addressed store, hash-verified

817 // First turn: 400 → fallback → success.
818 for _, e := range collect(c.Chat(context.Background(), nil, nil)) {
819 if e.Kind == EventError {
820 t.Fatalf("first turn must succeed via fallback, got error: %v", e.Err)
821 }
822 }
823 if len(bodies) != 2 {
824 t.Fatalf("first turn should send initial + retry (2 requests), got %d", len(bodies))
825 }
826 if !strings.Contains(bodies[0], `"reasoning_effort"`) {
827 t.Fatalf("first attempt should send reasoning_effort: %s", bodies[0])

Callers

nothing calls this directly

Calls 1

NewFunction · 0.70

Tested by

no test coverage detected