Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Nov 7, 2025

Gate XML formatting out of system prompts when ToolProtocol = native

Summary

  • Protocol selection is code-only via a constant and resolver (default: xml)
  • System prompt assembly passes the protocol and preserves section order
    • Effective protocol selection: system.ts
    • Tools catalog included only in XML mode; omitted in native: system.ts
    • TOOL USE section is protocol-aware: system.ts
    • Tool Use Guidelines are protocol-aware: system.ts
  • TOOL USE section (protocol-aware)
  • Tool Use Guidelines (protocol-aware)
  • Error/help reminders select protocol-specific instruction text via resolver

Tests

…ke tool protocol code-only; omit Tools catalog in native mode; update tests
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 7, 2025
@daniel-lxs daniel-lxs changed the title PR1: Gate XML out when native tool protocol is ON [DO NOT MERGE] Gate XML out when native tool protocol is ON Nov 7, 2025
@daniel-lxs daniel-lxs marked this pull request as ready for review November 7, 2025 20:10
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners November 7, 2025 20:10
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 7, 2025
@roomote
Copy link
Contributor

roomote bot commented Nov 7, 2025

Rooviewer Clock   See task on Roo Cloud

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

  • Module-level state in toolProtocolResolver.ts could cause protocol inconsistency across concurrent tasks
  • Unused protocol parameter in getToolDescriptionsForMode function
Previous reviews

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

…L only; remove unused protocol param from getToolDescriptionsForMode; protocol selection via non-exported code constant; tests pass
@daniel-lxs daniel-lxs changed the title [DO NOT MERGE] Gate XML out when native tool protocol is ON Gate XML out when native tool protocol is ON Nov 10, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Nov 10, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Nov 10, 2025
- Add type-safe TOOL_PROTOCOL constants with derived ToolProtocol type
- Extract getEffectiveProtocol() and isNativeProtocol() utility functions
- Add getToolInstructionsReminder() helper to eliminate duplication
- Remove repetitive protocol resolution patterns across 7 files
- Remove unnecessary skipXmlReferences intermediate variables
- All 142 prompt tests passing
When native tool calling is enabled, the guideline about formulating tool calls
is no longer needed since the provider handles the formatting automatically.
Only XML mode needs the explicit formatting instruction.
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 10, 2025
@mrubens mrubens merged commit e8ac3bf into main Nov 10, 2025
13 checks passed
@mrubens mrubens deleted the feat/pr1-native-tool-protocol-gate branch November 10, 2025 19:59
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 10, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer PR - Needs Preliminary Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants