anomalyco / anomalyco/opencode
providers: custom provider silently skipped when model capabilities omit tools
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Custom providers migrated from V1 following the migrate-v1 guide are silently skipped when a model's capabilities omits tools. V1 models only have modalities (no tool_call), so a literal migration yields capabilities: {input, output} without tools — the whole provider is then dropped with only a terse normalization warning. /api/config shows "providers": {}, /api/model has none of its models.
Server log (one line per provider, no field detail):
level=WARN message="configuration normalization diagnostic" path=$.providers.acme kind=invalid action="skipped malformed recognized value" role=server
Either missing capabilities.tools should fall back to the documented default (models doc: unknown models assume tool support), or the migrate-v1 guide should state tools is required and what to use when V1 has no tool_call. At minimum the warning should name the offending field, not just the provider path.
Plugins
none
OpenCode version
v2.0.9 (channel latest)
Steps to reproduce
- Add a custom provider whose model
capabilitieshasinput/outputbut notools:
{
"providers": {
"acme": {
"package": "aisdk:@ai-sdk/openai-compatible",
"settings": { "apiKey": "{env:ACME_API_KEY}", "baseURL": "https://llm.example.com/v1" },
"models": {
"coder": {
"limit": { "context": 262144, "output": 32768 },
"capabilities": { "input": ["text", "image"], "output": ["text"] }
}
}
}
}
}
- Start opencode (config hot-reloads).
opencode api get /api/config→providersis{}; log shows the WARN above.- Add
"tools": truetocapabilities→ provider loads, models appear enabled in/api/model.
Screenshot and/or share link
n/a (config/API output above)
Operating System
Windows 10.0.22000
Terminal
WarpTerminal
Contributor guide
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
Reproduce the configuration through /api/config and /api/model using the provider example, then inspect the provider capability normalization path and the migrate-v1 guide. Determine whether missing tools should use the documented default or be required by migration guidance; improve the diagnostic if possible. Done means the intended behavior is explicit and the provider is no longer silently absent without a useful explanation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100