anomalyco / anomalyco/opencode
fix: provider hook skipped for non-catalog providers
@jlongster is already working on this.
Since Jul 25, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When a plugin registers a ProviderHook targeting a provider not in the models-dev catalog (e.g., cursor via opencode-cursor-oauth), the hook is silently skipped because database[providerID] is undefined at provider.ts:1375.
The catalog builder only iterates providers that already exist in the built-in catalog, so third-party plugins can never populate models for custom providers.
Steps to Reproduce
- Install
opencode-cursor-oauthplugin - Configure cursor provider in
opencode.json - Run
opencode auth login --provider cursor - Start opencode — cursor models do not appear in the model picker
Expected Behavior
Cursor models should appear in the model picker when the plugin is configured.
Actual Behavior
Cursor models are silently skipped because database["cursor"] is undefined.
Root Cause
In packages/opencode/src/provider/provider.ts:1375:
const provider = database[providerID]
if (!provider) continue
The database map is built from the models-dev catalog, which does not include third-party providers like cursor. The plugin hook is skipped before it can populate models.
Fix
Create a skeleton provider entry when database[providerID] is undefined, so the plugins models() function can populate it.
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.
Assessment
This issue has not been assessed yet.