Skip to content

Handle HTTP 429 and 500 errors as retryable in model provider #2095

@simon-agent-go-expert

Description

@simon-agent-go-expert

Problem

The docker agent model provider currently does not treat HTTP 429 (Too Many Requests) or HTTP 500 (Internal Server Error) responses as retryable errors, causing requests to fail immediately when these transient conditions occur.

Desired Behavior

HTTP 429 (Too Many Requests)

  • Treat as a retryable error only when there is no fallback model configured
  • Respect any Retry-After header sent by the server in the response to determine how long to wait before retrying
  • If no Retry-After header is present, use the existing backoff logic

HTTP 500 (Internal Server Error)

  • Treat as a retryable error unconditionally
  • Use the same backoff logic as other existing retryable errors (no Retry-After support needed)

Context

Discovered from agentic platform work where rate-limiting and transient server errors cause unnecessary failures that could be recovered automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions