Files
CLIProxyAPI/internal/runtime/executor
eli 2d7f5377e4 feat(vertex): honor full /publishers/ prefix in API-key base-url
The API-key vertex executor previously always appended
"/v1/publishers/google/models/{model}:{action}" to whatever base-url the
credential carried, so a base-url that already encoded the resource path
(e.g. "https://aiplatform.googleapis.com/v1/projects/{p}/locations/{l}/publishers/google/models")
would produce a duplicated "/v1" and return 404.

This change teaches the helper to:
  1. detect a base-url that already contains "/publishers/" and use it
     as-is (preserving any projects/locations segment), and
  2. skip inserting "/v1" when the trimmed base already ends in a
     version segment such as "/v1" or "/v1beta1".

Short third-party hosts like "https://zenmux.ai" keep working unchanged;
real Vertex API-key setups can now write the full resource prefix into
base-url to pick a specific project/location (e.g. us-central1 for
gemini-4-argon).

Includes a table-driven unit test covering empty, bare host, /v1,
/publishers/-full-prefix, v1beta1, and countTokens variants.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-15 18:36:57 +08:00
..