fix(auxiliary): pass raw explicit_base_url to _wrap_if_needed for Anthropic transport - #19772
Closed
luyao618 wants to merge 1 commit into
Closed
Conversation
Collaborator
Collaborator
…hropic transport The explicit_base_url branch in resolve_provider_client() was passing custom_base (_to_openai_base_url()-rewritten URL with /v1 appended) to _wrap_if_needed(). When _maybe_wrap_anthropic() forwarded this to build_anthropic_client(), the Anthropic SDK appended its own /v1/messages, producing a double /v1/v1/messages path — HTTP 404. PR NousResearch#17467 fixed the same class of bug for the named-custom-provider and _try_custom_endpoint branches, but missed the explicit_base_url branch (line ~2206). Fix: pass explicit_base_url (the raw, un-rewritten URL) so the Anthropic SDK constructs the correct /v1/messages path. Fixes NousResearch#19753
luyao618
force-pushed
the
fix/auxiliary-anthropic-double-v1-explicit-base-url
branch
from
May 5, 2026 10:38
24b8042 to
99380fe
Compare
Contributor
Author
|
Closing: this PR has been open for 1-2 weeks with no maintainer review and the codebase continues to evolve. Will re-submit if the fix is still relevant. |
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
Fixes #19753 — auxiliary title generation (and other aux tasks) returns HTTP 404 when using a
custom:<name>provider withapi_mode: anthropic_messagesand anexplicit_base_url.Root Cause
In
resolve_provider_client(), theexplicit_base_urlbranch (line ~2206) passescustom_base— the URL rewritten by_to_openai_base_url()with/v1appended — to_wrap_if_needed(). When_maybe_wrap_anthropic()forwards this tobuild_anthropic_client(), the Anthropic SDK appends its own/v1/messages, producing/v1/v1/messages→ 404.PR #17467 previously fixed this same class of bug for the named-custom-provider and
_try_custom_endpointbranches, but missed theexplicit_base_urlbranch.Fix
One-line change: pass
explicit_base_url(the raw, un-rewritten URL) instead ofcustom_baseto_wrap_if_needed(), so the Anthropic SDK constructs the correct path.Testing
tests/agent/test_auxiliary_explicit_base_url_anthropic.pythat verifies the source passesexplicit_base_url(notcustom_base) to_wrap_if_needed.Scope
agent/auxiliary_client.py— 1 line changedtests/agent/test_auxiliary_explicit_base_url_anthropic.py— new test file