Skip to content

fix(url): a base URL's own version takes the place of the client's /v1 - #288

Merged
fylorn merged 1 commit into
mainfrom
fix/base-version-replaces-v1
Oct 4, 2026
Merged

fylorn merged 1 commit into
mainfrom
fix/base-version-replaces-v1

Conversation

@fylorn

@fylorn fylorn commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

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

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
fylorn force-pushed the fix/base-version-replaces-v1 branch from 1cb59d1 to 9d3895a Compare October 4, 2026 16:09
@fylorn
fylorn merged commit 3597ac2 into main Oct 4, 2026
4 checks passed
@fylorn
fylorn deleted the fix/base-version-replaces-v1 branch October 4, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant