Skip to content

Add retry with exponential backoff for network tools #20

Description

@longzhi

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

  1. Implement configurable retry with exponential backoff for web_fetch_tool and web_search_tool
  2. Convert webhook.rs from linear to exponential backoff
  3. Only retry on timeout and 5xx errors (not 4xx client errors)
  4. Make max retries and base delay configurable

Impact

  • Resilience — transient failures handled transparently
  • Efficiency — avoids wasting LLM reasoning loops on retryable network errors

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: mediumImportant but not urgent, schedule itenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions