-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: emit tool_call_end events in OpenAI handler when streaming ends #10280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The OpenAiHandler 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. Changes: - Added tracking of active tool call IDs in createMessage() and handleStreamResponse() - Emit tool_call_end events when finish_reason === 'tool_calls' - Added test coverage for both regular and O3 family models Closes: #10275 Linear: ROO-269
Review complete. No issues found. The refactoring correctly extracts duplicate tool call processing logic into the new Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Consolidates the duplicated tool call processing logic from createMessage() and handleStreamResponse() into a single private helper method. This improves maintainability and ensures consistent behavior across both code paths.
Summary
The
OpenAiHandlerwas 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.Changes
src/api/providers/openai.tscreateMessage()andhandleStreamResponse()finish_reason === 'tool_calls', emittool_call_endevents for all tracked tool callssrc/api/providers/__tests__/openai.spec.tstool_call_endevents are emitted whenfinish_reason === 'tool_calls'Related
Important
OpenAiHandlernow emitstool_call_endevents when streaming ends withfinish_reason === 'tool_calls', ensuring proper event handling.OpenAiHandlernow emitstool_call_endevents whenfinish_reason === 'tool_calls'inopenai.ts.createMessage()andhandleStreamResponse().openai.spec.tsto verifytool_call_endevents are emitted for both regular and O3 family models.This description was created by
for 4f9bc49. You can customize this summary. It will automatically update as commits are pushed.