anomalyco / anomalyco/opencode
[FEATURE]: Allow wildcards in provider model whitelist/blacklist
@neriousy is already working on this.
Since Aug 14, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Provider whitelist/blacklist in opencode.json only accept exact model IDs. For providers with large or frequently changing catalogs this means listing every ID by hand and keeping the list current as the catalog changes.
Concrete case: I keep an OpenRouter key with zero credits as a free fallback. I want the model picker to show only OpenRouter's :free models. Today that means whitelisting 16 IDs by hand, and the list goes stale every time OpenRouter adds or removes a free model. With wildcard support it would be one stable line:
{ "provider": { "openrouter": { "whitelist": ["*:free"] } } }
Proposed shape: treat whitelist/blacklist entries as wildcard patterns where * matches any characters, reusing the existing Wildcard util that permission rules already use. Entries without a * behave exactly like today's exact match, so existing configs are unaffected.
Prior art: #18326 asked for the same and was auto-closed after 60 days of inactivity. #23283 implemented it with regex literals and was closed by the automated PR cleanup on age and reaction count, with no review feedback. #9203 also requested glob support. So this has been suggested before, but it never received a maintainer decision. I am opening a fresh issue as the auto-close comment suggested, and I have a PR ready using glob syntax instead of regex to match the permission-rule convention.
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.