fix(url): a base URL's own version takes the place of the client's /v1 - #288
Merged
Merged
Conversation
A base URL that ends with a version segment other than v1 got the client's path appended whole: Zhipu's OpenAI-compatible endpoint `https://open.bigmodel.cn/api/paas/v4` became `…/paas/v4/v1/chat/completions`, a 404, and so did Volcengine Ark (`…/api/v3`) and Baidu Qianfan (`…/v2`), for requests and model lists alike. `/v1/…` is the OpenAI and Anthropic clients' conventional prefix; when the base URL carries its own version, that version now replaces it. A different version the path names itself (Gemini's `/v1beta/…`) is still appended, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fylorn
force-pushed
the
fix/base-version-replaces-v1
branch
from
October 4, 2026 16:09
1cb59d1 to
9d3895a
Compare
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.
A base URL ending with a version segment other than `v1` got the client path appended whole: `https://open.bigmodel.cn/api/paas/v4\` + `/v1/chat/completions` became `…/paas/v4/v1/chat/completions`, a 404. Same for Volcengine Ark (`…/api/v3`) and Baidu Qianfan (`…/v2`), for requests, connection checks and model lists.
`/v1/…` is the OpenAI and Anthropic clients' conventional prefix; when the base URL ends with its own version, that version now replaces it. A different version the path names itself (Gemini's `/v1beta/…`) is still appended, so `only_the_same_whole_version_segment_counts_as_a_repeat` is unchanged.
`tw-dialect` is shared with the enterprise gateway; the function's signature is unchanged, so it builds as before and picks up the fix with the next core version.
No release: merged to main without a tag, per the current pause on releases.
`cargo fmt --check`, `cargo clippy --workspace --all-targets -D warnings` and `cargo test --workspace` pass locally.
🤖 Generated with Claude Code