Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Nov 18, 2025

Important

Enables native tool calling for OpenAI-native provider by updating model configurations and handling tool call events in OpenAiNativeHandler.

  • Behavior:
    • Adds supportsNativeTools: true to multiple models in openai.ts, enabling native tool calling.
    • Handles tool call events (response.tool_call_arguments.delta, response.tool_call_arguments.done) in OpenAiNativeHandler in openai-native.ts.
  • Functions:
    • Implements processEvent() in openai-native.ts to accumulate and yield tool call data.
    • Updates handleResponsesApiMessage() and buildRequestBody() to support tool metadata.
  • Misc:
    • Adds currentToolCalls map to OpenAiNativeHandler to track tool call arguments.

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

- Update model definitions to support native tools
- Implement tool calling using OpenAI Responses API (flat tool structure)
- Fix conversation history format for tool calls and results
- Add strict mode schema transformation
- Handle streaming tool calls and result accumulation
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Nov 18, 2025
@roomote
Copy link
Contributor

roomote bot commented Nov 18, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No new issues found.

The latest commit simplifies tool call handling by removing redundant duplicate prevention logic. The change correctly uses the presence in currentToolCalls as the single source of truth for whether a tool call has been yielded, eliminating the need for a separate tracking set.

Previous reviews

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

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 18, 2025
@roomote
Copy link
Contributor

roomote bot commented Nov 18, 2025

Oroocle Clock   See task on Roo Cloud

Review complete. No issues were identified in this review. Native tool calling, strict tool schemas, and Responses API event handling all look consistent with the existing provider contracts.

  • No issues identified in this review

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

Tool definitions already comply with OpenAI Structured Outputs spec:
- All tools already have strict: true
- All tools already have additionalProperties: false
- All properties are already in required arrays
- Optional properties already use union types with null

The transformation adds unnecessary complexity and potential bugs
without providing any benefit.
OpenAI's Structured Outputs requires all properties to be in the
'required' array, even optional ones (which use nullable types).

The simplified transformation:
- Only ensures all properties are listed in required array
- Recursively processes nested objects and array items
- Doesn't modify type definitions (already correct in our tools)
- Much simpler than the original complex transformation
Simplified tool call handling by removing:
- yieldedCallIds Set for duplicate prevention
- Redundant checks before yielding tool calls
- Defensive default arguments ('|| "{}"')

Kept the completion event fallback as it's useful for handling
incomplete tool calls that didn't get a done event.

The implementation now more closely matches the cleaner roo.ts approach
while maintaining the completion fallback for reliability.
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 18, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Nov 18, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Nov 18, 2025
@mrubens mrubens merged commit f8d6e12 into main Nov 18, 2025
13 checks passed
@mrubens mrubens deleted the feat/openai-native-tools branch November 18, 2025 16:01
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 18, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Nov 18, 2025
mini2s added a commit to zgsm-ai/costrict that referenced this pull request Nov 19, 2025