fix: Add pony-alpha model and fix model lookup for prefixed model IDs

- Add openrouter/pony-alpha model to models-api.json fixture
- Fix getModel() to lookup models with provider prefix (e.g., openrouter/pony-alpha)
  When user specifies openrouter/pony-alpha, the code now correctly looks for
  the full model ID including prefix in the provider's models object

This fixes the 'ModelNotFoundError' when using OpenRouter models that have
prefixed IDs in the database.
This commit is contained in:
southseact-3d
2026-02-08 16:21:21 +00:00
parent 1fbf5abce6
commit 26c6f5f6c7
4 changed files with 218 additions and 20 deletions

View File

@@ -1200,7 +1200,11 @@ export namespace Provider {
throw new ModelNotFoundError({ providerID, modelID, suggestions })
}
const info = provider.models[modelID]
let info = provider.models[modelID]
// Try with provider prefix if not found (e.g., "openrouter/pony-alpha")
if (!info && !modelID.includes("/")) {
info = provider.models[`${providerID}/${modelID}`]
}
if (!info) {
const availableModels = Object.keys(provider.models)
const matches = fuzzysort.go(modelID, availableModels, { limit: 3, threshold: -10000 })

View File

@@ -27310,6 +27310,23 @@
"cost": { "input": 0, "output": 0 },
"limit": { "context": 1840000, "output": 0 }
},
"openrouter/pony-alpha": {
"id": "openrouter/pony-alpha",
"name": "Stealth",
"family": "pony",
"attachment": false,
"reasoning": true,
"tool_call": true,
"structured_output": true,
"temperature": true,
"release_date": "2026-02-06",
"last_updated": "2026-02-06",
"modalities": { "input": ["text"], "output": ["text"] },
"open_weights": false,
"cost": { "input": 0, "output": 0 },
"limit": { "context": 200000, "output": 131000 },
"status": "alpha"
},
"z-ai/glm-4.7": {
"id": "z-ai/glm-4.7",
"name": "GLM-4.7",