Skip to content

fix(agent): retry transient LLM HTTP errors#2768

Open
afjcjsbx wants to merge 1 commit intosipeed:mainfrom
afjcjsbx:fix/llm-http-5xx-retry
Open

fix(agent): retry transient LLM HTTP errors#2768
afjcjsbx wants to merge 1 commit intosipeed:mainfrom
afjcjsbx:fix/llm-http-5xx-retry

Conversation

@afjcjsbx
Copy link
Copy Markdown
Collaborator

@afjcjsbx afjcjsbx commented May 4, 2026

📝 Description

Fixes LLM request retry handling for transient provider HTTP errors. Previously, OpenRouter/OpenAI-compatible Status: 500 responses could fail the agent turn immediately when no model fallback candidate was available. This PR reuses the existing provider error classifier in the main LLM retry loop so transient HTTP/server errors are retried according to the configured retry policy.

🗣️ 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

Fixes #629

📚 Technical Context (Skip for Docs)

  • Reference URL: [BUG] Didn't retry if meet LLM call failed #629
  • Reasoning: The provider error classifier already maps transient HTTP statuses such as 500, 502, and 503 to retryable failover reasons. The main LLM retry loop now uses that classifier too, so single-provider runs can retry transient provider failures instead of dropping the task.

🧪 Test Environment

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

📸 Evidence (Optional)

Click to view Logs/Screenshots

☑️ 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.

@afjcjsbx afjcjsbx requested a review from alexhoshina May 4, 2026 16:08
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.

[BUG] Didn't retry if meet LLM call failed

1 participant