-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: Update tools to return structured JSON for native protocol #9373
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
All previously identified issues have been resolved.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
- 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
34a2c92 to
aa3296d
Compare
- 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
mrubens
approved these changes
Nov 19, 2025
mini2s
added a commit
to zgsm-ai/costrict
that referenced
this pull request
Nov 19, 2025
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.