fix: emit tool_call_end events in BaseOpenAiCompatibleProvider #10293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The
BaseOpenAiCompatibleProviderwas not emittingtool_call_endevents when the API stream ended withfinish_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.tscreateMessage()finish_reason === 'tool_calls', emittool_call_endevents for all tracked tool callssrc/api/providers/__tests__/base-openai-compatible-provider.spec.tstool_call_endevents are emitted whenfinish_reason === 'tool_calls'finish_reasonis nottool_callsAffected Providers
BaseOpenAiCompatibleProvider)Related
Important
Fixes
BaseOpenAiCompatibleProviderto emittool_call_endevents whenfinish_reason === 'tool_calls', preventing the extension from appearing stuck.base-openai-compatible-provider.ts, added tracking of active tool call IDs increateMessage().tool_call_endevents whenfinish_reason === 'tool_calls'for all tracked tool calls.base-openai-compatible-provider.spec.ts, added tests to verifytool_call_endevents are emitted correctly.tool_callsfinish reasons.BaseOpenAiCompatibleProvider.This description was created by
for 17cfa2b. You can customize this summary. It will automatically update as commits are pushed.