Skip to content

Cloudflare Workers AI models not appearing in interactive interface #2223

@security-labz-admin

Description

@security-labz-admin

=== OPENCODE CLOUDFLARE WORKERS AI BUG REPORT ===

Title: Cloudflare Workers AI models not appearing in interactive interface

Description:
When configuring Cloudflare Workers AI models in opencode.json, they appear when running 'opencode models' but don't show up as selectable options in the interactive interface.

Steps to reproduce:

  1. Configure Cloudflare Workers AI in opencode.json with custom provider name
  2. Run 'opencode models' - models appear in list
  3. Run 'opencode' - models don't appear in interactive interface
  4. Try using models via command line - works fine
  5. Try selecting in interface - models not available

Expected behavior:
Cloudflare Workers AI models should be selectable in the interactive interface.

Actual behavior:
Models only work via command line, not visible in interface.

Environment:

  • opencode version: 0.5.15
  • OS: Linux
  • Provider: Cloudflare Workers AI

Workaround:
Use 'openai' provider instead of custom provider name:

Working config:
{
"model": "openai/@cf/meta/llama-3.1-8b-instruct",
"provider": {
"openai": {
"npm": "@ai-sdk/openai-compatible",
"name": "Cloudflare Workers AI (via OpenAI)",
"options": {
"baseURL": "https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"@cf/meta/llama-3.1-8b-instruct": {
"name": "Llama 3.1 8B Instruct"
}
}
}
}
}

Broken config:
{
"model": "cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct",
"provider": {
"cloudflare-workers-ai": {
"npm": "@ai-sdk/openai-compatible",
"name": "Cloudflare Workers AI",
"options": {
"baseURL": "https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/v1"
},
"models": {
"@cf/meta/llama-3.1-8b-instruct": {
"name": "Llama 3.1 8B Instruct"
}
}
}
}
}

Impact:
This affects user experience by making Cloudflare Workers AI models only accessible via command line, not through the interactive interface that most users prefer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions