fix(auxiliary): pass original base_url to _maybe_wrap_anthropic in compression path - #20116
Closed
crayfish-ai wants to merge 1 commit into
Closed
fix(auxiliary): pass original base_url to _maybe_wrap_anthropic in compression path#20116crayfish-ai wants to merge 1 commit into
crayfish-ai wants to merge 1 commit into
Conversation
…tection Wrap-if-needed checks _endpoint_speaks_anthropic_messages() which looks for the /anthropic suffix. But _to_openai_base_url() already rewrote /anthropic → /v1 before this point, causing the anthropic wrapper to never trigger for MiniMax and similar custom endpoints that require it. Pass explicit_base_url (original) instead of custom_base (rewritten).
Collaborator
Collaborator
This was referenced May 7, 2026
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.
Bug
_wrap_if_needed checks _endpoint_speaks_anthropic_messages() which looks for the /anthropic suffix. But _to_openai_base_url() already rewrites /anthropic → /v1 before this point, causing the anthropic wrapper to never trigger for custom endpoints (e.g. MiniMax) that require it.
Fix
Pass explicit_base_url (original, e.g. /anthropic) instead of custom_base (already rewritten to /v1) to _wrap_if_needed, so the anthropic transport detection works correctly.
Testing
Context compression now succeeds with MiniMax and similar custom endpoints that require AnthropicMessages format.
Related
Upstream #17467 fixed a similar issue in _resolve_custom_runtime() but missed the _resolve_auto() Step 1 path used during compression.