Skip to content

openai-compatible provider options silently dropped if provider name contains dot #23622

Closed

Description

@Xeonacid

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:

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

  1. 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"
                    }
                }
            }
        }
    }
}
  1. Start HTTP(S) proxy to inspect traffic
mitmdump --flow-detail 4
# Listens on port 8080
  1. Set proxy environment variables
export NODE_TLS_REJECT_UNAUTHORIZED=0
export https_proxy=http://127.0.0.1:8080
  1. Start opencode and send any message using the configured model

  2. See the mitmdump console, the reasoning_effort field is missing from the request body.

Screenshot and/or share link

Image

Operating System

Unrelated

Terminal

Unrelated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions