fix: inject anthropic service_tier for OAuth auth#55922
fix: inject anthropic service_tier for OAuth auth#55922vincentkoc merged 4 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR removes the OAuth token ( Confidence Score: 5/5This PR is safe to merge — the change is minimal, correct, and well-covered by updated tests. One line removed from an early-return guard; the fix aligns OAuth token behavior with regular API key behavior and is backed by two targeted regression tests. No P0/P1 issues found. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/agents/pi-embedded-runner/anthropic-stream-wrappers.ts | Removes the OAuth token exclusion from the service_tier injection guard — one-line fix, correct and minimal. |
| src/agents/pi-embedded-runner-extraparams.test.ts | Flips existing OAuth test assertion and adds a regression test for fastMode: false → standard_only. |
Reviews (1): Last reviewed commit: "fix: inject anthropic service_tier for O..." | Re-trigger Greptile
|
@vincentkoc — OAuth tokens now receive service_tier injection, matching Claude Code CLI behavior. Reduces avoidable 529 cascades during high API load. 2 files, +22/-4. Fixes #55758. |
Remove the x-anthropic-billing-header, OAuth metadata injection, beta fetch interceptor, and claude-cli-identity.ts. These impersonated Claude Code at the API level to get Max-tier capacity routing. Instead, rely on the legitimate approach: - service_tier=auto for OAuth tokens (per PR openclaw#55922) - OAuth betas always injected (per outage2 fix) The billing header approach was fragile (caused 3 outages today) and ethically questionable. If service_tier alone isn't sufficient, we'll pursue the proper channel with Anthropic.
This comment was marked as spam.
This comment was marked as spam.
Remove the OAuth-token exclusion from createAnthropicFastModeWrapper so that sk-ant-oat-* requests receive service_tier injection, matching Claude Code CLI behavior and reducing avoidable 529 overload cascades. isAnthropicOAuthApiKey remains in use in createAnthropicBetaHeadersWrapper for beta header selection — it is not dead code after this change. Fixes openclaw#55758
64c6c9c to
9b5ca5c
Compare
This comment was marked as spam.
This comment was marked as spam.
* fix: inject anthropic service_tier for OAuth auth Remove the OAuth-token exclusion from createAnthropicFastModeWrapper so that sk-ant-oat-* requests receive service_tier injection, matching Claude Code CLI behavior and reducing avoidable 529 overload cascades. isAnthropicOAuthApiKey remains in use in createAnthropicBetaHeadersWrapper for beta header selection — it is not dead code after this change. Fixes openclaw#55758 * docs(changelog): note anthropic oauth service tier fix * Update CHANGELOG.md --------- Co-authored-by: Cypherm <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
* fix: inject anthropic service_tier for OAuth auth Remove the OAuth-token exclusion from createAnthropicFastModeWrapper so that sk-ant-oat-* requests receive service_tier injection, matching Claude Code CLI behavior and reducing avoidable 529 overload cascades. isAnthropicOAuthApiKey remains in use in createAnthropicBetaHeadersWrapper for beta header selection — it is not dead code after this change. Fixes openclaw#55758 * docs(changelog): note anthropic oauth service tier fix * Update CHANGELOG.md --------- Co-authored-by: Cypherm <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
* fix: inject anthropic service_tier for OAuth auth Remove the OAuth-token exclusion from createAnthropicFastModeWrapper so that sk-ant-oat-* requests receive service_tier injection, matching Claude Code CLI behavior and reducing avoidable 529 overload cascades. isAnthropicOAuthApiKey remains in use in createAnthropicBetaHeadersWrapper for beta header selection — it is not dead code after this change. Fixes openclaw#55758 * docs(changelog): note anthropic oauth service tier fix * Update CHANGELOG.md --------- Co-authored-by: Cypherm <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
* fix: inject anthropic service_tier for OAuth auth Remove the OAuth-token exclusion from createAnthropicFastModeWrapper so that sk-ant-oat-* requests receive service_tier injection, matching Claude Code CLI behavior and reducing avoidable 529 overload cascades. isAnthropicOAuthApiKey remains in use in createAnthropicBetaHeadersWrapper for beta header selection — it is not dead code after this change. Fixes openclaw#55758 * docs(changelog): note anthropic oauth service tier fix * Update CHANGELOG.md --------- Co-authored-by: Cypherm <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
No description provided.