Skip to content

fix: openai raw tool call issue#7397

Merged
louis-jan merged 4 commits into
mainfrom
fix/openai-raw-tool-call
Jan 25, 2026
Merged

fix: openai raw tool call issue#7397
louis-jan merged 4 commits into
mainfrom
fix/openai-raw-tool-call

Conversation

@louis-jan

@louis-jan louis-jan commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Describe Your Changes

Resolve the OpenAI raw tool call issue caused by the OpenAICompatible model factory. Update the Google provider to use the OpenAI-compatible endpoint to prevent regression.

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Copilot AI review requested due to automatic review settings January 25, 2026 05:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an OpenAI raw tool call issue by using the official @ai-sdk/openai SDK instead of the @ai-sdk/openai-compatible adapter. The change creates a dedicated handler for OpenAI models that properly supports tool calls, while keeping other providers using the OpenAI-compatible adapter.

Changes:

  • Added @ai-sdk/openai dependency (v2.0.0) to properly handle OpenAI-specific features
  • Created dedicated createOpenAIModel method following the same pattern as Anthropic and Google providers
  • Updated documentation to distinguish between OpenAI and OpenAI-compatible providers

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
web-app/src/lib/model-factory.ts Added import for @ai-sdk/openai, created createOpenAIModel method, updated switch case to route OpenAI provider separately, and updated comments to distinguish OpenAI from OpenAI-compatible providers
web-app/package.json Added @ai-sdk/openai package dependency at version ^2.0.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Minh141120
Minh141120 previously approved these changes Jan 25, 2026
Copilot AI review requested due to automatic review settings January 25, 2026 06:00
@louis-jan louis-jan force-pushed the fix/openai-raw-tool-call branch from f7a62d4 to 059cead Compare January 25, 2026 06:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web-app/src/lib/__tests__/model-factory.test.ts
@github-actions

github-actions Bot commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Barecheck - Code coverage report

Total: 26.22%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
web-app/src/lib/model-factory.ts54-66, 68, 70-91, 110, 137-139, 141-144, 146-155, 158-161, 163-165, 168-176, 178-181, 219-222

Copilot AI review requested due to automatic review settings January 25, 2026 06:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 11 to +13
* - google/gemini: Gemini models via Google Generative AI API (@ai-sdk/google v2.0)
* - OpenAI-compatible: OpenAI, Azure, Groq, Together, Fireworks, DeepSeek, Mistral, Cohere, etc.
* - openai: OpenAI models via OpenAI API (@ai-sdk/openai)
* - OpenAI-compatible: Azure, Groq, Together, Fireworks, DeepSeek, Mistral, Cohere, etc.

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation comment is now incorrect. It states that google/gemini providers use "Google Generative AI API (@ai-sdk/google v2.0)", but the implementation (lines 117-118, 129) now routes these providers through createOpenAICompatibleModel. The comment should be updated to reflect that google/gemini now use the OpenAI-compatible endpoint instead of the native Google AI SDK.

Copilot uses AI. Check for mistakes.
@louis-jan louis-jan merged commit c4ec907 into main Jan 25, 2026
23 checks passed
@louis-jan louis-jan deleted the fix/openai-raw-tool-call branch January 25, 2026 07:02
@github-project-automation github-project-automation Bot moved this to QA in Jan Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

3 participants