fix: recognize openrouter/auto during model lookup
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 134
- Forks
- 24
- Avg merge
- 8h 59m
- Merged PRs (30d)
- 23
Description
Bug Description
Kit emits a misleading warning for the valid OpenRouter auto-routing model:
Warning: model "auto" not found in model database for provider openrouter. Similar models: openrouter/auto
openrouter/auto is listed by kit models openrouter and is a valid OpenRouter model selector. The warning is cosmetic—the request is still passed through—but it suggests that the configured model is invalid and recommends the exact same model with its provider prefix.
Steps to Reproduce
- Configure Kit with
KIT_MODEL=openrouter/auto(or pass the equivalent model configuration). - Run Kit with a valid
OPENROUTER_API_KEY. - Observe the startup warning.
The warning also reproduces with the v0.105.0 binary. The same lookup logic appears in v0.107.0.
Relevant Code / Configuration
model: "openrouter/auto"
The model database entry is structured approximately as:
{
"openrouter": {
"models": {
"openrouter/auto": {
"id": "openrouter/auto"
}
}
}
}
But CreateProvider parses the configured value into provider openrouter and model name auto, then calls:
registry.LookupModel("openrouter", "auto")
LookupModel indexes directly with the bare model name:
modelInfo, exists := providerInfo.Models[modelID]
That misses the database key openrouter/auto, causing the warning and the self-referential suggestion.
Affected Component
Model database lookup / OpenRouter provider
Kit Version
v0.105.0 (installed binary); the same code path is present in v0.107.0.
Additional Context
Possible fixes include either:
- normalizing model database keys for the
openrouterprovider to bare model names when building the registry; or - making
LookupModeltry the provider-qualified key (provider + "/" + modelID) after the bare key.
The latter should preserve the current behavior for providers whose model keys are already bare. A regression test for LookupModel("openrouter", "auto") would help prevent this from recurring.
The provider still works because the model database is advisory, so this does not block requests; it only produces an incorrect warning and prevents metadata-based handling for this model.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at registry.LookupModel and the CreateProvider call path described in the issue, then inspect how provider model keys are stored and matched. Add coverage for LookupModel("openrouter", "auto") and verify that the valid model no longer produces the misleading warning while existing bare-key providers still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- ai, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100