Skip to content

Embedded runner reports 'API rate limit reached' when provider has full headroom #41515

@AbebaCo

Description

@AbebaCo

Bug Description

The embedded agent runner reports API rate limit reached. Please try again later. and retries with exponential backoff, even when the actual API provider has full rate limit headroom available.

Steps to Reproduce

  1. Set system default model to anthropic/claude-haiku-4-5-20251001 (API key auth)
  2. Trigger an embedded agent run (e.g., via a system event from the health monitor)
  3. Observe the embedded run fail with rate limit error
  4. Simultaneously, call the same model via curl with the same API key — succeeds with full headroom:
anthropic-ratelimit-requests-limit: 4000
anthropic-ratelimit-requests-remaining: 3999

Expected Behavior

The embedded runner should successfully call the Anthropic API using the configured API key from auth-profiles.json.

Actual Behavior

The embedded runner fails immediately with API rate limit reached and retries 4 times with exponential backoff before giving up. Each health monitor event (every ~3 min) spawns a new run that also fails, creating continuous log noise:

[agent/embedded] embedded run agent end: runId=xxx isError=true error=⚠️ API rate limit reached. Please try again later.

Hypothesis

The embedded runner may be:

  • Using a different auth path than the one in auth-profiles.json (e.g., reading from openclaw.json auth.profiles which only has provider/mode, not the actual key)
  • Applying an internal rate limiter that is more restrictive than the actual provider limits
  • Caching a stale auth credential from a prior provider configuration

Environment

  • OpenClaw version: 2026.3.8 (3caab92)
  • OS: macOS (Darwin 25.3.0 arm64)
  • Node: v22.22.0
  • System default model: anthropic/claude-haiku-4-5-20251001
  • Auth: API key in auth-profiles.json (verified working via direct curl)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions