Skip to content

test: test fallback qwen3#6886

Closed
michaelneale wants to merge 3 commits intomainfrom
micn/test-fallback-qwen3
Closed

test: test fallback qwen3#6886
michaelneale wants to merge 3 commits intomainfrom
micn/test-fallback-qwen3

Conversation

@michaelneale
Copy link
Collaborator

pushing here to check it passes live tests

emergentbit and others added 3 commits February 1, 2026 07:41
When using Qwen3-coder model through Ollama with many tools (6+), the
model outputs XML-style tool calls in the content field instead of
using the native JSON tool_calls format. This causes Goose to fail
to execute any tools.

This commit adds XML parsing as a fallback mechanism:

- Add parse_xml_tool_calls() helper function using regex to parse
  <function=name><parameter=key>value</parameter></function> format
- Modify response_to_message() to check for XML tool calls when no
  JSON tool_calls are found in the response
- Modify response_to_streaming_message() to accumulate text and
  parse XML tool calls when stream completes
- Add comprehensive unit tests for XML parsing

The fix is backward-compatible and only activates when JSON tool_calls
are absent, ensuring existing providers continue to work normally.

Tested with Qwen3-coder:latest via Ollama with 11 developer tools.

Signed-off-by: Krispy <krispy@emergentbit.com>
…o/goose into kuccello-fix/qwen3-coder-xml-tool-parsing

* 'fix/qwen3-coder-xml-tool-parsing' of github.com:kuccello/goose:
  fix: add XML tool call parsing fallback for Qwen3-coder via Ollama
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments