Skip to content

Comments

feat(retry): add retry logic with backoff for LLM calls#594

Open
tbeaudouin05 wants to merge 1 commit intosipeed:mainfrom
tbeaudouin05:feat(retry)--add-retry-logic-with-backoff-for-LLM-calls
Open

feat(retry): add retry logic with backoff for LLM calls#594
tbeaudouin05 wants to merge 1 commit intosipeed:mainfrom
tbeaudouin05:feat(retry)--add-retry-logic-with-backoff-for-LLM-calls

Conversation

@tbeaudouin05
Copy link

📝 Description

Add bounded retry logic for LLM calls with escalating per-attempt timeouts and backoffs, retryable detection (timeouts and HTTP 5xx), user-facing retry notices, and shared helper + tests. Integrates retries into both the main agent loop (alongside existing context-compression retry and fallback chain) and the shared tool loop.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

📚 Technical Context (Skip for Docs)

  • Reference URL:
  • Reasoning: Implemented bounded retries (45s/90s/120s per attempt, 2s/5s backoffs) that retry on timeouts and HTTP 5xx; keep existing context-compression retry for context/token errors; send user-facing notices when retries occur.

🧪 Test Environment

  • Hardware:
  • OS:
  • Model/Provider:
  • Channels:

📸 Evidence (Optional)

Click to view Logs/Screenshots Screenshot 2026-02-21 at 18 31 59

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

- Implement `DoWithRetry` wrapper for LLM calls in agent loop and tool loop
- Add configurable timeouts (45s, 90s, 120s) and backoffs (2s, 5s) for retry attempts
- Send user notifications on retry attempts via outbound messages
- Rename `callLLM` to `callLLMOnce` to clarify single-attempt semantics
- Add `sendRetryNotice` helper in toolloop to notify users of retry status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant