fix(auxiliary): only rewrite /anthropic to /v1 for dual-surface hosts (salvage #83782) - #85532
Merged
Conversation
Unconditionally rewriting any */anthropic base_url to /v1 broke Anthropic-only custom gateways (e.g. Alibaba Bailian Token Plan) used by auxiliary compression/vision under provider=auto. Keep MiniMax dual-surface hosts rewriting; leave pure Anthropic paths intact. Fixes #83642
Substring matching over the whole URL let a path containing 'api.minimax' false-positive an Anthropic-only gateway into the /anthropic→/v1 rewrite. Parse the host and match exact-domain / subdomain suffixes (plus the api.minimax.* prefix family) instead.
…ewrite policy Unknown hosts (e.g. gateway.example.com) no longer get /anthropic→/v1; use a real dual-surface MiniMax base for the rewrite assertions and add a case proving Anthropic-only gateways keep their path on the OpenAI wire.
Contributor
૮ >ﻌ< ა ci reviewran on 2a38cd1 — test(agent): align explicit-base auxiliary tests with host-a
|
Contributor
|
Thanks for the salvage onto current main — and for tightening host-anchored marker matching so a path containing Closing #83782 as superseded by this tip. The dropped multiplex busy-mode fixture hunk was indeed already covered on main. |
19 tasks
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
_to_openai_base_urlnow rewrites/anthropic→/v1ONLY for known dual-surface hosts (MiniMax family; ZAI/paas/v4mapping kept) — Anthropic-only gateways like Bailian/apps/anthropickeep their path. Salvage of #83782 by @686f6c61 onto current main, authorship preserved. Fixes #83642.This is the class-wide completion of the #85466 point fix: it reaches the aux-iteration call sites and API-key branch where no
api_modeis in scope, which per-site guards could not.Changes
agent/auxiliary_client.py: rewrite policy inverted to a dual-surface host allowlist; fixup (ours): marker matching host-anchored via urlparse (exact/subdomain suffix match) — a URL whose path containsapi.minimaxno longer false-positivestest_auxiliary_explicit_base_anthropic.pyaligned with the new policytest_multiplex_busy_input_mode.pyfixture hunk — already fixed on main via f51aa6aValidation
/apps/anthropicon aux calls/apps/v1→ 404api.minimaxappearing in a pathNote for merge: unknown dual-surface gateways (e.g. a LiteLLM proxy exposing both wire formats under
/anthropic) now keep their path on OpenAI-wire aux calls; wrap-detection routes such URLs to the native transport in practice.Infographic