Skip to content

fix(anthropic): send dashed model ids upstream for the dotted catalog ids - #16425

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.52from
Louayzouaoui1:fix/anthropic-dotted-model-ids
Oct 13, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.52from
Louayzouaoui1:fix/anthropic-dotted-model-ids

Conversation

@Louayzouaoui1

Copy link
Copy Markdown
Contributor

Summary

Fixes the first part of #16406. The first-party anthropic registry (and /v1/models) lists dotted ids (claude-haiku-4.5, claude-sonnet-4.6, claude-opus-4.6, …), but the Anthropic Messages API only accepts the dashed form. PROVIDER_MODEL_ALIASES had no anthropic entry, so the dotted id went upstream unchanged and 404ed, or was served by an older model through model-family fallback while the response still named the requested one.

  • open-sse/services/modelCanonicalization.ts: adds an anthropic alias entry mapping the seven dotted ids to their dashed equivalents (the list from the issue).
  • open-sse/handlers/chatCore/claudeEffortVariant.ts: when an effort suffix is stripped (claude-opus-4.7-high), the base id is now passed through the same provider alias. Without this, the suffixed variants the issue mentions would still go upstream dotted, because the id is aliased before the suffix is split.

Dashed ids, other providers, and the existing kiro and zed-hosted aliases (dashed → dotted) are unchanged.

Related Issues

Validation

  • Change type: provider / routing
  • Focused tests: the new test file, chatcore-claude-effort-variant, claude-effort-suffix-strip, claude-effort-variants, kiro-model-aliases, model-alias-*, models-catalog-*, antigravity-model-aliases and the zed-hosted tests (156 pass)
  • eslint and prettier --check on the changed files
  • Based on the tip of release/v3.8.52
  • Production-code change includes a new automated test in this PR

Tests Added Or Updated

  • Added tests/unit/anthropic-dotted-model-ids-16406.test.ts: alias resolution for all seven ids, routing through getModelInfoCore (anthropic/<dotted> → dashed model), that dashed ids and the kiro direction are untouched, and the effort-suffix case. Three of the four tests fail without the change.
  • Added the changelog fragment changelog.d/fixes/0000-anthropic-dotted-model-ids.md.

Coverage Notes

  • Both changed code paths are covered by the new test file.

Reviewer Notes

  • anthropic/claude-opus-4.5 is routed by an older legacy alias to the claude provider as claude-opus-4-5-20251101, so it never reaches the new table. The test skips it and says why. The entry is kept so the table matches the registry and the issue's list.
  • I didn't run the full unit suite or npm run lint locally; CI runs them.

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.

2 participants