fix(auxiliary): prevent URL double-rewrite for custom anthropic_messages endpoints - #29624
fix(auxiliary): prevent URL double-rewrite for custom anthropic_messages endpoints#29624yimi128 wants to merge 1 commit into
Conversation
…ges endpoints When a custom provider uses api_mode=anthropic_messages (e.g. Zhipu GLM via /api/anthropic), the auxiliary client's auto-detect chain (Step 1) passed the explicit_base_url through _to_openai_base_url(), which rewrote /api/anthropic → /api/paas/v4. Then _maybe_wrap_anthropic() detected api_mode=anthropic_messages and built an Anthropic SDK client on the already-rewritten URL. The Anthropic SDK appended /v1/messages to /api/paas/v4, producing /v4/v1/messages → HTTP 404. The fix checks api_mode early: when anthropic_messages is declared, build an AnthropicAuxiliaryClient directly from the original URL, bypassing _to_openai_base_url entirely. Falls back to the existing OpenAI-wire path on ImportError or other failures.
|
Thanks for tracing this transport mismatch. The premise still holds on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
|
This bug is now fixed on main via #85466 (salvage of #64891). Credit correction: your PR was submitted May 21 — the EARLIEST fix for this branch, more than seven weeks before the version that merged. The pre-merge duplicate sweep missed it (phrasing variance), which is our miss, not yours. The merged variant was picked on implementation grounds (it keeps the |
markdown
Bug Description