Fix OpenAI compat parallel tool calls - #6719
Conversation
🦋 Changeset detectedLatest commit: 6fd2f74 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe OpenAI-compatible chat conversion now groups consecutive function calls into one assistant message with multiple ChangesOpenAI-compatible parallel tool calls
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Prompt
participant OpenAiLanguageModel
participant ChatCompletionsAPI
Prompt->>OpenAiLanguageModel: provide consecutive function calls
OpenAiLanguageModel->>OpenAiLanguageModel: group calls into one assistant tool_calls message
OpenAiLanguageModel->>ChatCompletionsAPI: send assistant message and matching tool responses
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Comment |
Bundle Size Analysis
|
Fixes #6702
Groups consecutive function calls into a single assistant message before emitting their tool outputs, matching strict Chat Completions message ordering requirements.
Adds a regression test covering two parallel tool calls and their adjacent outputs.
Testing
pnpm --filter @effect/ai-openai-compat test --run test/OpenAiLanguageModel.test.tspnpm --filter @effect/ai-openai-compat checkpnpm lint-fixSummary by CodeRabbit
Bug Fixes
Tests