Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented Nov 18, 2025

Important

Adds native tool calling support to OpenAI-compatible models, handling tool calls in both streaming and non-streaming modes, with updated tests and tool schema.

  • Behavior:
    • Adds supportsNativeTools: true to openAiModelInfoSaneDefaults in openai.ts.
    • Handles tool calls in createMessage() in openai.ts for both streaming and non-streaming modes.
    • Processes tool calls in handleO3FamilyMessage() and handleStreamResponse() in openai.ts.
  • Tests:
    • Adds tests for tool calls in streaming and non-streaming modes in openai.spec.ts.
    • Tests tool call handling for O3 models in openai.spec.ts.
  • Misc:
    • Updates read_file tool schema to require line_ranges in read_file.ts.

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

@mrubens mrubens requested review from cte and jr as code owners November 18, 2025 19:57
@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

Re-review completed. All previously flagged issues have been resolved.

  • Fix breaking schema change in read_file tool - line_ranges marked as required but described as "Optional"
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
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 18, 2025
…to BaseProvider

- Add convertToolsForOpenAI() and convertToolSchemaForOpenAI() methods to BaseProvider
- These methods ensure all properties are in required array and convert nullable types
- Remove line_ranges from required array in read_file tool (converter handles it)
- Update OpenAiHandler and BaseOpenAiCompatibleProvider to use helper methods
- Eliminates code duplication across multiple tool usage sites
- Fixes: OpenAI completion error: 400 Invalid schema for function 'read_file'
@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 bc6fad1 into main Nov 18, 2025
19 of 20 checks passed
@mrubens mrubens deleted the open_ai_compatible_native_tool_calling branch November 18, 2025 23:20
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Nov 18, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 18, 2025
@R-omk
Copy link
Contributor

R-omk commented Nov 19, 2025

@mrubens Could you please explain where the option should appear in the model settings? Should this setting appear in any model, or is there some preliminary filtering occurring?

mini2s added a commit to zgsm-ai/costrict that referenced this pull request Nov 19, 2025