Skip to content

fix(opencode): enable native OpenAI-compatible providers#31628

Open
slegarraga wants to merge 1 commit into
anomalyco:devfrom
slegarraga:fix/openai-compatible-native-tool-calls
Open

fix(opencode): enable native OpenAI-compatible providers#31628
slegarraga wants to merge 1 commit into
anomalyco:devfrom
slegarraga:fix/openai-compatible-native-tool-calls

Conversation

@slegarraga

Copy link
Copy Markdown

Issue for this PR

Closes #26412

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Custom providers using @ai-sdk/openai-compatible were still rejected by the native runtime unless their provider ID was one of the built-in IDs. This lets OpenAI-compatible providers use the native runtime based on the SDK package, while still rejecting unsupported packages.

I also added coverage for a custom baseURL provider and for streaming tool-call deltas where later chunks carry function.name: null.

How did you verify your code works?

  • bun test test/provider/openai-compatible-chat.test.ts from packages/llm
  • bun test test/session/llm-native.test.ts from packages/opencode
  • bun typecheck from packages/llm
  • bun typecheck from packages/opencode
  • pre-push bun turbo typecheck

Screenshots / recordings

Not a UI change.

Checklist

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom OpenAI-compatible provider: "Expected 'function.name' to be a string" on streaming tool call chunks

1 participant