Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jan 14, 2026

Summary

Some OpenAI-compatible providers (streaming via Responses API or similar) emit tool_call_arguments.delta events without repeating the call_id or name that was provided in the initial output_item.added (or output_item.done if it arrived earlier). This caused the OpenAiNativeHandler to emit partial tool call chunks with undefined ID/name, which the downstream parser ignored or failed to handle correctly.

This change ensures that we capture the tool identity from output_item events and use it as a fallback for subsequent argument deltas that lack identity.

Changes

  • Added pendingToolCallId and pendingToolCallName to OpenAiNativeHandler state.
  • Updated processEvent to capture tool identity from response.output_item.added and response.output_item.done events.
  • Updated processEvent to use the pending identity when processing response.tool_call_arguments.delta or response.function_call_arguments.delta if the event itself is missing the ID/name.
  • Added a regression test case in src/api/providers/__tests__/openai-native-tools.spec.ts.

Important

Fixes missing tool identity handling in OpenAiNativeHandler by using pending identifiers from initial events as fallbacks.

  • Behavior:
    • Fixes issue in OpenAiNativeHandler where tool_call_arguments.delta events without call_id or name were ignored by capturing tool identity from output_item.added and output_item.done events.
    • Uses pendingToolCallId and pendingToolCallName as fallbacks for missing identifiers in subsequent events.
  • State Management:
    • Adds pendingToolCallId and pendingToolCallName to OpenAiNativeHandler to track last observed tool identity.
  • Testing:
    • Adds regression test in openai-native-tools.spec.ts to verify handling of missing identifiers in tool_call_arguments.delta events.

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

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jan 14, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 14, 2026

Oroocle Clock   See task on Roo Cloud

Review complete. No actionable issues found; the change looks correct and the regression test covers the described provider behavior.

  • No issues found

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants