From 0ede534b459fdce52199c00a358318a5eeb298bd Mon Sep 17 00:00:00 2001 From: mrbeandev Date: Mon, 16 Feb 2026 19:57:18 +0530 Subject: [PATCH] feat(providers): add PICOCLAW_HTTP_TIMEOUT env var to support slow LLMs (fixes #312) --- pkg/providers/http_provider.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/providers/http_provider.go b/pkg/providers/http_provider.go index a72df6087..9d94f8e5f 100644 --- a/pkg/providers/http_provider.go +++ b/pkg/providers/http_provider.go @@ -14,6 +14,7 @@ import ( "io" "net/http" "net/url" + "os" "strings" "time" @@ -28,8 +29,16 @@ type HTTPProvider struct { } func NewHTTPProvider(apiKey, apiBase, proxy string) *HTTPProvider { + // Default timeout 120s, override via env + timeout := 120 * time.Second + if envTimeout := os.Getenv("PICOCLAW_HTTP_TIMEOUT"); envTimeout != "" { + if d, err := time.ParseDuration(envTimeout); err == nil { + timeout = d + } + } + client := &http.Client{ - Timeout: 120 * time.Second, + Timeout: timeout, } if proxy != "" {