Summary
OAuth tokens (sk-ant-oat-*) are excluded from service_tier injection in createAnthropicFastModeWrapper. During high API load, this causes OAuth-authenticated requests to receive significantly more HTTP 529 overloaded_error responses compared to Claude Code (which uses the same OAuth token type but with service_tier enabled).
Root cause
In src/agents/pi-embedded-runner/anthropic-stream-wrappers.ts, the fast mode wrapper explicitly skips OAuth tokens:
// createAnthropicFastModeWrapper
if (model.api !== "anthropic-messages" || model.provider !== "anthropic"
|| !isAnthropicPublicApiBaseUrl(model.baseUrl)
|| isAnthropicOAuthApiKey(options?.apiKey)) // ← OAuth skipped here
return underlying(model, context, options);
// Only non-OAuth gets service_tier
payloadObj.service_tier = serviceTier;
This means OAuth-authenticated requests are sent without any service_tier parameter, resulting in lowest priority during high load. Claude Code itself uses the same sk-ant-oat token type but includes service_tier, which is why it works fine while OpenClaw gets 529s under the same conditions.
Steps to reproduce
- Configure OpenClaw with an Anthropic OAuth token (
sk-ant-oat-*)
- Use
claude-opus-4-6 as primary model
- Send messages during periods of elevated Anthropic API load
- Observe repeated 529
overloaded_error responses, even with Sonnet fallback configured (both models fail)
Meanwhile, Claude Code CLI using the same account/token type works without issues.
Evidence from logs
132 overloaded errors in a single day, in bursts of 5 retries per request, across 11 separate runs:
"httpCode": "529",
"providerErrorType": "overloaded_error",
"model": "claude-opus-4-6",
"provider": "anthropic"
The cooldown cascade makes it worse: after 4 failures, the auth profile enters a 1-hour cooldown (calculateAuthProfileCooldownMs with 5^n backoff), blocking all subsequent requests.
Expected behavior
OAuth tokens should include service_tier in API requests, matching the behavior of Claude Code and other first-party Anthropic clients.
Actual behavior
OAuth tokens are excluded from service_tier injection, receiving no priority during high load, leading to persistent 529 errors and cooldown cascades.
Related
OpenClaw version
2026.3.13 (also verified unchanged in 2026.3.24)
Operating system
macOS 26.4 (arm64)
Summary
OAuth tokens (
sk-ant-oat-*) are excluded fromservice_tierinjection increateAnthropicFastModeWrapper. During high API load, this causes OAuth-authenticated requests to receive significantly more HTTP 529overloaded_errorresponses compared to Claude Code (which uses the same OAuth token type but withservice_tierenabled).Root cause
In
src/agents/pi-embedded-runner/anthropic-stream-wrappers.ts, the fast mode wrapper explicitly skips OAuth tokens:This means OAuth-authenticated requests are sent without any
service_tierparameter, resulting in lowest priority during high load. Claude Code itself uses the samesk-ant-oattoken type but includesservice_tier, which is why it works fine while OpenClaw gets 529s under the same conditions.Steps to reproduce
sk-ant-oat-*)claude-opus-4-6as primary modeloverloaded_errorresponses, even with Sonnet fallback configured (both models fail)Meanwhile, Claude Code CLI using the same account/token type works without issues.
Evidence from logs
132 overloaded errors in a single day, in bursts of 5 retries per request, across 11 separate runs:
The cooldown cascade makes it worse: after 4 failures, the auth profile enters a 1-hour cooldown (
calculateAuthProfileCooldownMswith5^nbackoff), blocking all subsequent requests.Expected behavior
OAuth tokens should include
service_tierin API requests, matching the behavior of Claude Code and other first-party Anthropic clients.Actual behavior
OAuth tokens are excluded from
service_tierinjection, receiving no priority during high load, leading to persistent 529 errors and cooldown cascades.Related
context-1mbetaOpenClaw version
2026.3.13 (also verified unchanged in 2026.3.24)
Operating system
macOS 26.4 (arm64)