Skip to content

Broken XML auto fixing #7156

@BHznJNs

Description

@BHznJNs

App Version

3.25.16

API Provider

OpenAI Compatible

Model Used

Qwen3-coder-480B

Roo Code Task Links (Optional)

https://app.roocode.com/share/d70b106a-17d9-4780-a356-917e96407980

🔁 Steps to Reproduce

For some LLM providers (like Targon), the model can not response with a right XML tool call sequence, but a broken sequence like:

read_file>
args>
<file>
<path>main.gopath>
</file>
args>
read_file>

Even with such a prompt:

Please reply with the XML sequence below:
\`\`\`
<read_file>
<args>
<file>
<path>main.go</path>
</file>
</args>
</read_file>
\`\`\`

Maybe we can config a small model to use it to fix the returned broken XML like:

Please try fix the broken XML sequence below:
\`\`\`
read_file>
args>
<file>
<path>main.gopath>
</file>
args>
read_file>
\`\`\`

We can have an extra config item for OpenAI Compatible mode, when the item is on, it will automatically detect if the response has a broken XML tool call, and use the small model to fix it.

💥 Outcome Summary

Expected tool calls successfully, but responses with a broken XML sequence like:

read_file>
args>
<file>
<path>main.gopath>
</file>
args>
read_file>

📄 Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - Needs InfoMissing details or unclear. Waiting on author to provide more context.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Issue [Needs Info]

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions