Skip to content

fix: respect configured API versions in endpoint URLs - #157

Merged
lich0821 merged 4 commits into
lich0821:masterfrom
wozhenbang2004:fix/versioned-endpoint-base-urls
Oct 29, 2026
Merged

lich0821 merged 4 commits into
lich0821:masterfrom
wozhenbang2004:fix/versioned-endpoint-base-urls

Conversation

@wozhenbang2004

Copy link
Copy Markdown
Contributor

Fixes #137.

An endpoint ending in /api/coding/paas/v4 was sent requests at /api/coding/paas/v4/v1/chat/completions and returned 404. The same mismatch affected the connection probe.

Share the base-path normalization used by proxy requests and endpoint probes. If the base path ends in a numeric API version, append the resource without another /v1. Use the same rule for OpenAI model discovery. Root URLs and non-versioned prefixes keep their existing /v1 path; the Codex backend and image paths remain covered by existing tests.

Regression tests exercise the outgoing request path and query, HTTP probes for the three compatible formats, and model discovery. The versioned request/probe cases fail against the original code. Configuration docs include a versioned-base example.

Validation (Linux, Go 1.27.3):

  • go test ./internal/... ./cmd/server/... -count=1 — passed.
  • go vet ./internal/... ./cmd/server/... — passed.
  • go mod verify — passed.

The Wails desktop app was not built; no desktop UI code changed. No paid provider calls were made.

AI-assisted implementation and test execution.

@lich0821
lich0821 merged commit 425ffca into lich0821:master Oct 29, 2026
7 checks passed
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.

不支持https://open.bigmodel.cn/api/coding/paas/v4吗

2 participants