You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Native LLM runtime hard-blocks Google/Gemini and other non-OpenAI providers #38893
The native LLM runtime at packages/opencode/src/session/llm/native-runtime.ts has a hardcoded provider allowlist that blocks Google, Amazon Bedrock, Azure, and OpenRouter from using the native LLM path, even though native-request.ts has working adapters for them.
// native-runtime.ts:55 — the gateif(providerID!=="openai"&&providerID!=="anthropic"&&!providerID.startsWith("opencode"))return{type: "unsupported",reason: "..."}if(npm!=="@ai-sdk/openai"&&npm!=="@ai-sdk/openai-compatible"&&npm!=="@ai-sdk/anthropic")return{type: "unsupported",reason: "..."}
// native-request.ts:165-177 — the adapterif(model.api.npm==="@ai-sdk/openai")returnOpenAI...
if(model.api.npm==="@ai-sdk/anthropic")returnAnthropic...
if(model.api.npm==="@ai-sdk/google")returnGoogle... // works but gate blocksif(model.api.npm==="@ai-sdk/amazon-bedrock")returnAmazonBedrock...
if(model.api.npm==="@ai-sdk/azure")returnAzure...
if(model.api.npm==="@openrouter/ai-sdk-provider")returnOpenRouter...
Impact
Users who enable OPENCODE_EXPERIMENTAL_NATIVE_LLM=true cannot use Google/Gemini, Amazon Bedrock, Azure, or OpenRouter through the native path. The AI SDK fallback silently catches these, so the bug manifests as inconsistent retry/streaming behavior rather than a visible error.
Root cause
The allowlist in statusWithFetch() was written when only three providers had native adapters. As more adapters were added to native-request.ts, the gate was never updated. The two lists are duplicated and drift apart when providers are added.
Suggested fix
Replace hardcoded provider/npm checks with a SUPPORTED_NPM_PACKAGES set exported from native-request.ts. The gate derives truth from the same source as the adapter, so they stay in sync by construction.
Activity
github-actions commentedon Sep 24, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.