Skip to content

bug(platform): a Claude Code run the provider refuses with 503 fails instead of waiting for capacity #5348

Closed

Description

@yannickmonney

Summary

When every account behind an Anthropic-format gateway is at its usage limit, the gateway answers 503 (sub2api: 503 No available accounts). Tale settles such a Claude Code task run as harness_error, not model_capacity. Each refusal spends one of the run's three automatic retries and one of the task's three automated starts an hour; after that the task stays In progress with no run. Dispatch starts only To do, so the task is never started again, also once the accounts are back. The wait for model capacity that waiting and failed runs describes never begins for these runs.

Evidence (agents.tale.dev, v0.5.94, 2026-11-03)

One Development project: a Coder pool of 4 on Claude Code with Opus 5.5, through a custom provider (sub2api with 10 Claude accounts, 8 of them at their weekly limit).

  • In the 24 hours to 22:45 UTC, 292 of 403 task runs ended harness_error with api_error_status 503 and API Error: 503 No available accounts…, in bursts of 43 to 54 an hour.
  • After the 18:00 UTC burst, 35 tasks sat In progress, each with its newest run failed on that 503 and no run since. To do was empty, so dispatch started nothing while two accounts were free again.
  • In the source (v0.5.97 too), agent_run_host.ts settles model_capacity only when the harness end carries providerErrorKind: 'model_capacity', or when the exec failed with exceeded retry limit, last status: 429. The Claude Code parser (claude-stream-json.ts) records api_error_status but never sets model_capacity, so a 503 or a 529 reads as a crash.

Expected

A provider's refusal for capacity (503 and 529) holds the model's runs as model_capacity does: the retry spends no attempt and no hourly start, and the task waits instead of failing for good.

Options

  1. Settle a Claude Code turn that ends with api_error_status 503 or 529 as model_capacity, as the codex parser already does for its overload text.
  2. Have dispatch take up an In progress task whose newest run failed on a provider refusal once the model's capacity hold ends, or move such a task back to To do.

Stopgap on that install

A node timer moves such a task back to To do every 15 minutes, an hour after its last failed run and only while at least one of the gateway's accounts is free.

Activity

  1. added
    bug
    service: platform
    agent-ready
    on Nov 3, 2026
  2. tale-code-bot commented on Nov 4, 2026

    @tale-code-bot
    Collaborator

    Split off this issue: #5350. While the CLI is still retrying a 503 on its own (about three minutes), the 2-minute probe proof of the model's capacity hold clears the hold. The wait then restarts every few minutes instead of growing, and its twelve-hour limit never ends it.

    The first part is TALE-435 on branch fix/claude-code-capacity-refusal. It settles Claude Code's 503 and 529 refusals as model_capacity, so the run's retry spends no attempt and no hourly start and the task waits instead of failing for good. It lands through the merge train and closes this issue when it reaches main.

  3. added a commit that references this issue on Nov 4, 2026
    b609968
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions