Skip to content

fix(executor): add retry-after parsing to gemini and claude executors#3527

Open
IDika31 wants to merge 2 commits into
router-for-me:devfrom
IDika31:fix/retry-after-parsing
Open

fix(executor): add retry-after parsing to gemini and claude executors#3527
IDika31 wants to merge 2 commits into
router-for-me:devfrom
IDika31:fix/retry-after-parsing

Conversation

@IDika31
Copy link
Copy Markdown

@IDika31 IDika31 commented May 24, 2026

What

Add consistent Retry-After parsing to gemini_executor, gemini_vertex_executor,
and claude_executor.

Changes

  • gemini_executor.go: replace raw statusErr with newGeminiStatusErr() at 3 error sites
  • gemini_vertex_executor.go: same at 6 error sites
  • claude_executor.go: add parseClaudeRetryAfter() to read the standard
    Retry-After HTTP header on 429/529 responses

Why

Without accurate retry-after, the cooldown system falls back to guessing.
Accounts re-enter the pool before quota actually recovers, causing
repeated failures and increased latency.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de296be4d2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/runtime/executor/claude_executor.go
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for parsing the Retry-After header across Claude, Gemini, and Gemini Vertex executors to improve error handling for rate-limited or overloaded requests. Review feedback highlights that the Claude executor's parsing logic should be extended to handle HTTP-date formats to ensure full RFC 9110 compliance. Additionally, the Gemini and Gemini Vertex implementations currently lack the necessary header passing to their error constructors, which is required to successfully extract the Retry-After information.

Comment thread internal/runtime/executor/gemini_executor.go
Comment thread internal/runtime/executor/gemini_vertex_executor.go
Comment thread internal/runtime/executor/claude_executor.go
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