`anthropic:messages:` / `anthropic:completion:` provider IDs truncate model names containing : (registry.ts doesn't join splits)
Describe the bug
Several provider factories build the model name from a single segment of providerPath.split(':') (e.g. splits[1] or splits[2]) instead of rejoining everything after the prefix. Model IDs that contain a : are silently truncated at the first extra colon.
// src/providers/registry.ts (anthropic)
const splits = providerPath.split(':');
const modelName = splits[2]; // drops everything after the next ':'This affects anthropic:, azure:, voyage:, ai21: and a few others in registry.ts and openclaw/index.ts. It's the same bug as #347 and #267, and most providers (OpenAI, Ollama, Bedrock, etc.) already use the correct .slice(n).join(':') pattern.
To Reproduce
- Add a provider whose model ID contains a colon:
providers:
- id: 'anthropic:messages:anthropic.claude-3-5-sonnet-20241022-v2:0'- Run
promptfoo eval. - See that the provider receives
anthropic.claude-3-5-sonnet-20241022-v2, with the:0dropped.
Expected behavior The full model name after the provider prefix is preserved for every provider:
const modelName = splits.slice(2).join(':'); // or slice(1) for <provider>:<model>Screenshots
System information:
- Promptfoo version: V 0.123.0
Additional context Related: #347, #267. A shared helper for parsing model names from provider paths would help prevent this from coming back.
Source: promptfoo/promptfoo