Skip to content

[Bug]: Ollama+Qwen tool-calling regression: thinking-only output, malformed <tool_call>, dropped actions #3079

Description

@G7CNF

Summary

With ollama provider, both qwen3.5:9b and qwen3.5:35b-a3b frequently produce reasoning/thinking text but fail to execute structured tool calls in ZeroClaw, causing dropped actions and user-facing incomplete replies.

This reproduces as:

  • Ollama returned empty content with only thinking ... Model may have stopped prematurely.
  • Malformed <tool_call>: expected tool-call object in tag body (JSON/XML/GLM)
  • occasional provider-side parse errors: expected element type <function> but have <parameter>

Affected component

provider / agent tool-call parsing (ollama path)

Severity

S1 - workflow blocked

Current behavior

Agent replies with planning text like "I need to use file_open..." but tool action is not actually dispatched/executed.

Expected behavior

If model indicates tool usage intent, ZC should receive/normalize valid tool-call payload and dispatch tool execution, without leaking internal malformed protocol states.

Environment

  • ZeroClaw gateway: 127.0.0.1:42617
  • Provider: ollama
  • Models tested: qwen3.5:9b, qwen3.5:35b-a3b
  • Date observed: 2026-03-08 through 2026-03-09

Evidence (local logs)

From /opt/homebrew/var/zeroclaw/logs/daemon.stdout.log:

  • 2026-03-08T15:44:28Z qwen3.5:9b only-thinking + malformed <tool_call>
  • 2026-03-09T17:47:49Z qwen3.5:35b-a3b only-thinking
  • 2026-03-09T17:54:36Z qwen3.5:35b-a3b only-thinking
  • 2026-03-09T18:15:30Z ollama 500: expected element type <function> but have <parameter>

Additional validation

Direct calls to Ollama API (outside ZC) with the same task and a simple file_open tool schema returned valid structured tool_calls and done_reason: "stop" for both models. This suggests a ZC integration/parsing mismatch rather than a base model inability.

Reproduction steps

  1. Configure ZC with provider ollama and model qwen3.5:35b-a3b (also seen on qwen3.5:9b).
  2. Ask agent to run a simple tool action, e.g. "open SOUL.md in the default editor".
  3. Observe intermittent no-op assistant response and daemon warnings listed above.

Notes

Potentially related historical issues (closed): #1109, #1442, #234, #418.
This appears to be a regression/new variant because the same failure pattern is still reproducible on current builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions