Skip to content

Conversation

@daniel-lxs
Copy link
Member

This PR updates tool responses to return structured JSON when using native tool calling protocol, fixing race conditions and improving protocol handling. It also includes comprehensive test updates to ensure type safety and correctness.

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

roomote bot commented Nov 18, 2025

Rooviewer Clock   See task on Roo Cloud

All previously identified issues have been resolved.

  • Fix double-encoding error in WriteToFileTool line 66 where rooIgnoreError is wrapped inside toolError, causing malformed nested JSON for native protocol
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
- Resolved merge conflict in presentAssistantMessage.ts after rebasing onto main
- Derive toolProtocol from isNative boolean (based on tool call ID presence)
- Updated system.ts to call getModesSection with correct signature
- Maintained protocol detection logic from main branch
- All TypeScript compilation errors resolved
@daniel-lxs daniel-lxs force-pushed the fix/native-tool-response-json branch from 34a2c92 to aa3296d Compare November 18, 2025 23:52
- Remove toolError wrapper around rooIgnoreError calls in all tools
- rooIgnoreError already returns properly formatted JSON for native protocol
- Wrapping it in toolError caused malformed nested JSON: {"status":"error","error":"{\"status\"...}"}
- Updated test expectations to match new signature
- Fixes double-encoding issue that prevented models from parsing error responses correctly

Files updated:
- ExecuteCommandTool.ts
- WriteToFileTool.ts
- GenerateImageTool.ts
- ApplyDiffTool.ts
- InsertContentTool.ts
- executeCommandTool.spec.ts
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 19, 2025
@mrubens mrubens merged commit 271d01b into main Nov 19, 2025
12 checks passed
@mrubens mrubens deleted the fix/native-tool-response-json branch November 19, 2025 01:01
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Nov 19, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 19, 2025
mini2s added a commit to zgsm-ai/costrict that referenced this pull request Nov 19, 2025