Files
routstrd/tests/integrations
redshift 9f26a72155 fix(pi): version the provider base URL and root the Anthropic models
The provider base URL was the daemon root, which made every OpenAI-shaped
request reach the node as a bare `/chat/completions`. routstr-core accepts
both spellings but forwards the path verbatim, and providers whose base URL
carries no version segment (Tinfoil) answer the bare path with a 404 — so
`tinfoil-*` models were unreachable from pi, at the cost of a spend/refund
cycle per attempt. Root was chosen to stop the Anthropic transport from
doubling `/v1`, which is a real problem but only affects one family.

Restore the versioned base URL (as v0.4.11 had it) and move the exception to
where it belongs: models served over the Anthropic transport now carry the
ROOT as a per-model `baseUrl`, which pi honours over the provider's
(definition.baseUrl ?? config.baseUrl). The OpenAI transports keep the
versioned base URL they expect, so the default — inherited by every model the
integration does not pin, including hand-added ones — is correct:

  other   -> {root}/v1/chat/completions
  gpt-*   -> {root}/v1/responses
  claude* -> {root}/v1/messages   (per-model baseUrl = root)

The override is keyed on the effective transport rather than the model name,
so a user-curated `api: "anthropic-messages"` on a non-claude model is served
correctly too.
2026-10-04 15:07:24 +08:00
..