Problem
Network tools lack proper retry logic:
| Tool |
Current Behavior |
web_fetch_tool.rs |
No retry on failure |
web_search_tool.rs |
No retry on failure |
webhook.rs:69 |
Has retry but uses linear delay (RETRY_DELAY * attempt) |
Transient network failures (timeouts, 5xx errors) cause immediate tool failure, which then consumes a reasoning loop iteration to retry at a higher level.
Proposed Solution
- Implement configurable retry with exponential backoff for
web_fetch_tool and web_search_tool
- Convert
webhook.rs from linear to exponential backoff
- Only retry on timeout and 5xx errors (not 4xx client errors)
- Make max retries and base delay configurable
Impact
- Resilience — transient failures handled transparently
- Efficiency — avoids wasting LLM reasoning loops on retryable network errors
Problem
Network tools lack proper retry logic:
web_fetch_tool.rsweb_search_tool.rswebhook.rs:69RETRY_DELAY * attempt)Transient network failures (timeouts, 5xx errors) cause immediate tool failure, which then consumes a reasoning loop iteration to retry at a higher level.
Proposed Solution
web_fetch_toolandweb_search_toolwebhook.rsfrom linear to exponential backoffImpact