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
fix(github-copilot): Grok models get endpoint error due to defaulting to generic OpenAI SDK #44103
GitHub Copilot Grok models (e.g. copilot-grok-4.6) get an "endpoint error" when used through the opencode CLI. The models are resolved from models.opencode.ai and inherit the generic @ai-sdk/openai-compatible SDK via the GitHub Copilot provider-level npm field, instead of the custom @ai-sdk/github-copilot SDK.
The custom SDK is required to send requests with the correct URL path, headers, and error handling for the GitHub Copilot API.
Root Cause
In fromModelsDevModel() at packages/opencode/src/provider/provider.ts, the npm fallback chain resolves provider.npm ?? "@ai-sdk/openai-compatible". For the github-copilot provider, provider.npm is "@ai-sdk/openai-compatible" (truthy), so the custom @ai-sdk/github-copilot SDK is never selected.
Fix
Three targeted changes:
provider.ts (2 locations) — Override the npm to @ai-sdk/github-copilot for github-copilot provider, before falling back to provider.npm. Both the catalog path (fromModelsDevModel) and the config-defined model path (apiNpm assignment) are covered.
model.ts:fromCatalogModel — Allow @ai-sdk/github-copilot package through the same OpenAICompatibleChat.route that @ai-sdk/openai-compatible uses.
model.ts:supported — Include @ai-sdk/github-copilot alongside @ai-sdk/openai-compatible in the support check.
Activity
github-actions commentedon Aug 22, 2026
This issue might be a duplicate of existing issues. Please check:
model not accessible via /chat/completions)rekram1-node commentedon Sep 26, 2026
fixed in v2 https://opencode.ai/v2/docs