cmdWebsearch called fetch() with no timeout and no retry, so a hung connection blocked indefinitely and transient 429/5xx/network failures were not recovered. Add AbortSignal.timeout (configurable via GSD_WEBSEARCH_TIMEOUT_MS, default 10s) and a bounded retry loop (max 2 retries, exponential backoff + jitter) for 429/5xx/network errors, honoring Retry-After on 429 (capped at 60s). Non-429 4xx fail immediately (no wasted retries). Transient-exhausted failures report an `attempts` count. Worst-case time is bounded by timeout*(1+retries)+backoff. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
5
.changeset/308-websearch-timeout-retry.md
Normal file
5
.changeset/308-websearch-timeout-retry.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
type: Fixed
|
||||
pr: 308
|
||||
---
|
||||
Add a per-attempt timeout (configurable via GSD_WEBSEARCH_TIMEOUT_MS) and bounded retry with Retry-After handling to the Brave websearch fetch (#308).
|
||||
Reference in New Issue
Block a user