fix(dualagent): improve no-tool-call feedback with explicit XML format reminder

When the LLM fails to emit a tool_call XML block, the feedback now includes
the exact XML format expected with a concrete example for json.validate.
This helps smaller models understand the exact output format required.
This commit is contained in:
2026-01-20 01:36:03 +00:00
parent b1deccaa26
commit 9718048dff

View File

@@ -319,9 +319,27 @@ export class DualAgentOrchestrator {
const proposals = this.driver.parseToolCallProposals(driverResponse.content);
if (proposals.length === 0) {
// No tool calls, continue the conversation
// No tool calls found - remind the model of the exact XML format
driverResponse = await this.driver.continueWithMessage(
'Please either use a tool to make progress on the task, or indicate that the task is complete with <task_complete>summary</task_complete>.'
`No valid tool call was found in your response. To use a tool, you MUST output the exact XML format:
<tool_call>
<tool>tool_name</tool>
<action>action_name</action>
<params>{"param1": "value1"}</params>
</tool_call>
For example, to validate JSON:
<tool_call>
<tool>json</tool>
<action>validate</action>
<params>{"jsonString": "{\\"key\\":\\"value\\"}", "requiredFields": ["key"]}</params>
</tool_call>
Or to complete the task:
<task_complete>your final JSON output here</task_complete>
Please output the exact XML format above.`
);
this.conversationHistory.push(driverResponse);
continue;