Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Description
When configuring a custom provider using @ai-sdk/openai-compatible with a dotted provider name (e.g. "example.com"), model-level options such as reasoningEffort are silently dropped and never appear in the API request body.
The key mismatch between what OpenCode passes and what @ai-sdk/openai-compatible expects in providerOptions:
- OpenCode () falls back to model.providerID as the key → "example.com"
const key = sdkKey(model.api.npm) ?? model.providerID - SDK (https://github.com/vercel/ai/blob/bc1bf40d099b49cc5840927d26b9d450fe2511ca/packages/openai-compatible/src/chat/openai-compatible-chat-language-model.ts#L127-L129) derives the lookup key as
config.provider.split('.')[0]→ "example"
The keys don't match, so parseProviderOptions() in the SDK never finds the options.
Plugins
N/A
OpenCode version
1.14.19, or latest dev
Steps to reproduce
- Configure a custom provider with a dot in provider name
~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"example.com": {
"npm": "@ai-sdk/openai-compatible",
"name": "example.com",
"options": {
"baseURL": "https://api.openai.com/v1",
"apiKey": "sk-example"
},
"models": {
"model": {
"name": "model",
"options": {
"reasoningEffort": "max"
}
}
}
}
}
}- Start HTTP(S) proxy to inspect traffic
mitmdump --flow-detail 4
# Listens on port 8080- Set proxy environment variables
export NODE_TLS_REJECT_UNAUTHORIZED=0
export https_proxy=http://127.0.0.1:8080-
Start opencode and send any message using the configured model
-
See the
mitmdumpconsole, thereasoning_effortfield is missing from the request body.
Screenshot and/or share link
Operating System
Unrelated
Terminal
Unrelated
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Activity