Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Dec 23, 2025

Summary

The BaseOpenAiCompatibleProvider was not emitting tool_call_end events when the API stream ended with finish_reason === 'tool_calls'. This could cause the extension to appear stuck waiting for more stream data.

This is the same fix applied in PR #10280 to the OpenAI handler, now applied to the base class that ZAi and other OpenAI-compatible providers extend.

Changes

src/api/providers/base-openai-compatible-provider.ts

src/api/providers/__tests__/base-openai-compatible-provider.spec.ts

  • Added test assertions to verify tool_call_end events are emitted when finish_reason === 'tool_calls'
  • Added coverage for single and parallel tool call scenarios
  • Added negative test for when finish_reason is not tool_calls

Affected Providers

  • ZAi (extends BaseOpenAiCompatibleProvider)
  • Any other providers extending this base class

Related


Important

Fixes BaseOpenAiCompatibleProvider to emit tool_call_end events when finish_reason === 'tool_calls', preventing the extension from appearing stuck.

  • Behavior:
    • In base-openai-compatible-provider.ts, added tracking of active tool call IDs in createMessage().
    • Emit tool_call_end events when finish_reason === 'tool_calls' for all tracked tool calls.
  • Tests:
    • In base-openai-compatible-provider.spec.ts, added tests to verify tool_call_end events are emitted correctly.
    • Covered single and parallel tool call scenarios, and negative test for non-tool_calls finish reasons.
  • Affected Providers:
    • ZAi and other providers extending BaseOpenAiCompatibleProvider.

This description was created by Ellipsis for 17cfa2b. You can customize this summary. It will automatically update as commits are pushed.

The BaseOpenAiCompatibleProvider was not emitting tool_call_end events
when the API stream ended with finish_reason === 'tool_calls'. This
could cause the extension to appear stuck waiting for more stream data.

- Added tracking of active tool call IDs in createMessage()
- When finish_reason === 'tool_calls', emit tool_call_end events for
  all tracked tool calls
- Added test coverage for single and parallel tool call scenarios
- Matches the pattern used by OpenAI handler (PR #10280)

Affects ZAi and other providers extending this base class.
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Dec 23, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 23, 2025

Oroocle Clock   See task on Roo Cloud

Reviewed BaseOpenAiCompatibleProvider tool call end handling changes. No issues found.

  • No issues to address

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 23, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 23, 2025
@hannesrudolph hannesrudolph merged commit a8ac2ce into main Dec 23, 2025
24 checks passed
@hannesrudolph hannesrudolph deleted the fix/base-openai-compatible-tool-call-end branch December 23, 2025 04:25
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Dec 23, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants