Skip to content

fix(llm): add @ai-sdk/openai-compatible to sdkKey mapping - #34602

Closed
Robin1987China wants to merge 1 commit into
anomalyco:devfrom
Robin1987China:fix-openai-compatible-options
Closed

fix(llm): add @ai-sdk/openai-compatible to sdkKey mapping#34602
Robin1987China wants to merge 1 commit into
anomalyco:devfrom
Robin1987China:fix-openai-compatible-options

Conversation

@Robin1987China

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #5674

Type of change

  • Bug fix

What does this PR do?

The sdkKey() in transform.ts maps provider names to SDK configuration namespaces but is missing the @ai-sdk/openai-compatible case. This means providers wrapping OpenAI-compatible APIs (e.g., vLLM, Ollama) never pick up their SDK-level options like baseURL or headers from opencode.json because the key falls back to model.providerID which does not match the "openaiCompatible" namespace the SDK actually reads.

This adds the missing case.

How did you verify your code works?

  • Ran full test suite: 276/276 passing
  • Typecheck: bun run typecheck passes cleanly

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

sdkKey() maps npm packages to the providerOptions namespace the AI SDK
expects, but had no case for @ai-sdk/openai-compatible.  This caused
provider options (reasoningEffort, etc.) to be written under the custom
providerID key, which @ai-sdk/openai-compatible never reads.

Add the missing case so the key written matches the key the SDK reads.

Closes anomalyco#5674
@rekram1-node

Copy link
Copy Markdown
Collaborator

I left a comment on the issue with what I found: https://github.com/anomalyco/opencode/issues/5674#issuecomment-4850281402\n\nPlease follow up with me if you think this is incorrect. Closing for now.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom OpenAI-compatible provider options not being passed to API calls

2 participants