Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 27, 2026

Summary

This PR improves error messages when an API provider (such as OpenAI-compatible proxies like kie.ai) does not properly support native function/tool calling.

Problem

When using OpenAI-compatible proxies that do not fully support the function calling API, the model may output XML-formatted tool calls in its text response. The previous error messages were confusing for users:

  • "XML tool calls are no longer supported. Remove any XML tool markup..."
  • "Invalid tool call: missing tool_use.id. XML tool calls are no longer supported..."

These messages were technical and implied user error when the actual issue is API provider compatibility.

Solution

Updated error messages to be more user-friendly:

  1. XML tool markup detection: "The model is outputting XML-formatted tool calls instead of using native function calling. This typically happens when your API provider does not fully support OpenAI's function/tool calling feature. Please verify that your API provider supports native tool calling, or try using a different provider."

  2. Missing tool call ID: "Invalid tool call: the model's tool call is missing a required ID. This typically happens when your API provider does not fully support OpenAI's function/tool calling feature. Please verify that your API provider supports native tool calling, or try using a different provider."

Changes

  • Updated presentAssistantMessage.ts with improved error messages
  • Updated BaseTool.ts with consistent messaging
  • Updated corresponding test files

Testing

  • All 15 affected tests pass
  • Type checking passes
  • Lint passes

Fixes #11011

…ling support

When an API provider (such as OpenAI-compatible proxies like kie.ai) does not
properly support native function/tool calling, the model may output XML-formatted
tool calls in its text response. The previous error messages were technical and
confusing for users.

Updated error messages to:
- Explain what happened in user-friendly terms
- Identify the likely cause (API provider not supporting native tool calling)
- Provide actionable guidance

Fixes #11011
@roomote
Copy link
Contributor Author

roomote bot commented Jan 27, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found.

The PR cleanly improves error messages to be more user-friendly when API providers don't fully support native function/tool calling. The changes are minimal, well-tested, and accomplish the stated goal.

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

@roomote
Copy link
Contributor Author

roomote bot commented Jan 27, 2026

Closing in favor of PR #11014, which contains the proper fix with the openAiStrictToolMode setting. This PR (error message improvement) was an intermediate attempt before understanding the root cause.

@roomote roomote bot closed this Jan 27, 2026
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jan 27, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] Gemini 3 error on kie.ai

1 participant