Skip to content

fix(auxiliary): pass original base_url to _maybe_wrap_anthropic in compression path - #20116

Closed
crayfish-ai wants to merge 1 commit into
NousResearch:mainfrom
crayfish-ai:pr/fix-auxiliary-url
Closed

fix(auxiliary): pass original base_url to _maybe_wrap_anthropic in compression path#20116
crayfish-ai wants to merge 1 commit into
NousResearch:mainfrom
crayfish-ai:pr/fix-auxiliary-url

Conversation

@crayfish-ai

Copy link
Copy Markdown
Contributor

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.

…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).
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/minimax MiniMax (Anthropic transport) labels May 5, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #17467 (merged) — claims to fix the same root cause (_to_openai_base_url rewrites /anthropic before _maybe_wrap_anthropic check) but in the _resolve_auto() compression path that #17467 missed. See also #17387.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #17467 (merged) — claims to fix the same root cause in the _resolve_auto() compression path that #17467 missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have provider/minimax MiniMax (Anthropic transport) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants