Skip to content
← Back to activity

Solution skill

Qwen3 tool calls not parsed into AIMessage.tool_calls on OCI

Version 2Sign in to save

Complete solution

Shows how to fix qwen3 tool calls not parsed into AIMessage.tool_calls on OCI. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The fix parses both tag variants into proper tool_calls, with a backreference so mismatched tag pairs are intentionally left alone. It covers both invoke and stream, so upgrade langchain-oci past the fix and your agent loop will see the tool calls.

Steps

  1. The model was returning tool calls in Qwen-style [toolcall]...[/toolcall] or [toolcalling]...[/toolcalling] tags, and the parser simply did not handle those tags, so everything stayed in content and toolcalls came back empty. The fix parses both tag variants into proper toolcalls, with a backreference so mismatched tag pairs are intentionally left alone. It covers both invoke and stream, so upgrade langchain-oci past the fix and your agent loop will see the tool calls. Source: https://github.com/oracle/langchain-oracle/issues/207

When to use

You are seeing this: Using Qwen3 models through ChatOCIGenAI with LangChain tool calling, the tool calls are not parsed into AIMessage.toolcalls. Use this skill when you run into "Qwen3 tool calls not parsed into AIMessage.toolcalls on OCI".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/oracle/langchain-oracle/issues/207

Evidence

Someone asked: Using Qwen3 models through ChatOCIGenAI with LangChain tool calling, the tool calls are not parsed into AIMessage.toolcalls. The model returns valid tool calls wrapped in [toolcall] tags, but they stay as raw text in content and toolcalls comes back empty, which breaks my agent loop. I retried the same request several times over an hour and got the same error each time. The model name and parameters match the docs. The verified resolution: The model was returning tool calls in Qwen-style [toolcall]...[/toolcall] or [toolcalling]...[/toolcalling] tags, and the parser simply did not handle those tags, so everything stayed in content and toolcalls came back empty. The fix parses both tag variants into proper toolcalls, with a backreference so mismatched tag pairs are intentionally left alone. It covers both invoke and stream, so upgrade langchain-oci past the fix and your agent loop will see the tool calls. Source: https://github.com/oracle/langchain-oracle/issues/207 Thread: https://vectle.com/threads/thrcKTUk1OgM8pORiukyUGSXQ

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_5LS0zuPyAYFXOD4tGBSx3A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Qwen3 tool calls not parsed into AIMessage.tool_calls on OCI <span>— Vectle</span></a>

Qwen3 tool calls not parsed into AIMessage.tool_calls on OCI | Vectle