Repository navigation
fix(providers): centralize Anthropic endpoint classification - #59608
Merged
Merged
Conversation
vincentkoc
marked this pull request as ready for review
April 2, 2026 10:32
Contributor
Greptile SummaryThis PR centralizes Anthropic endpoint classification by adding Confidence Score: 5/5
Reviews (1): Last reviewed commit: "Merge branch 'main' into fix/anthropic-p..." | Re-trigger Greptile |
vincentkoc
force-pushed
the
fix/anthropic-provider-endpoint-classification
branch
from
April 2, 2026 10:51
354b0d7 to
a52b3dd
Compare
ngutman
pushed a commit
that referenced
this pull request
Apr 3, 2026
* fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
5 tasks
steipete
pushed a commit
to duncanita/openclaw
that referenced
this pull request
Apr 4, 2026
…w#59608) * fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
…w#59608) * fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
…w#59608) * fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 24, 2026
…w#59608) * fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
Nachx639
pushed a commit
to Nachx639/clawdbot
that referenced
this pull request
Jun 17, 2026
…w#59608) * fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
vixco
pushed a commit
to vixco/openclaw
that referenced
this pull request
Aug 16, 2026
…w#59608) * fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
globalcaos
pushed a commit
to globalcaos/tinkerclaw
that referenced
this pull request
Sep 29, 2026
…w#59608) * fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
lhfer
pushed a commit
to lhfer/openclaw
that referenced
this pull request
Oct 11, 2026
…w#59608) * fix(providers): centralize Anthropic endpoint classification * fix(agents): share Anthropic thinking recovery gating
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
service_tierinjection still lived inextensions/anthropic/stream-wrappers.ts, while the shared request-policy engine already owned equivalent native-vs-proxy classification for OpenAI-family and Google-family.anthropic-publicto the shared endpoint classifier insrc/agents/provider-attribution.ts, migrated the Anthropic stream wrappers to use that classifier, and added spoofed-host regressions at both the classifier and payload-mutation layers.baseUrlsemantics, and does not broaden request policy beyond endpoint classification forservice_tiergating.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
api.anthropic.comdetector in the stream wrapper instead of consuming the shared endpoint classifier.anthropic-publicendpoint class, so the stream wrapper owned its own native-vs-proxy policy branch.git blame, prior PR, issue, or refactor if known): follows the request-policy rollout in refactor(providers): centralize request attribution policy #59433, refactor(providers): add internal request config seam #59454, fix(providers): centralize media request shaping #59469, fix(providers): centralize stream request headers #59542, and the Google-family endpoint classification in fix(providers): centralize Google endpoint classification #59556.Regression Test Plan (if applicable)
src/agents/provider-attribution.test.ts,src/agents/pi-embedded-runner-extraparams.test.tsapi.anthropic.comendpoints get Anthropicservice_tierinjection; proxied and spoofed Anthropic-looking hosts do not.service_tiernon-injection coverage already existed and was extended.User-visible / Behavior Changes
service_tierdefaults still apply on native Anthropic endpoints.service_tierinjection.Diagram (if applicable)
Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation:Repro + Verification
Environment
baseUrlfor Anthropic modelsSteps
pnpm buildandpnpm check.Expected
api.anthropic.comclassifies asanthropic-public.service_tierinjects only on native Anthropic endpoints.Actual
Evidence
Human Verification (required)
anthropic-publicfor native Anthropic; Anthropic fast-mode and explicit service-tier injection still work on native hosts; spoofed Anthropic-looking hosts do not getservice_tier.baseUrlstill preserves prior native-default behavior.service_tierendpoint gating.Review Conversations
Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoRisks and Mitigations