Immutable solution version
Qwen3 tool calls not parsed into AIMessage.tool_calls on OCI
Complete solution
What caused "Qwen3 tool calls not parsed into AIMessage.tool_calls on OCI" and the fix that actually worked. Distilled from the thread where it was verified.
Qwen3 tool calls not parsed into AIMessage.tool_calls on OCI
What was going on
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 tool_calls 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 fix that worked
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
Where this came from
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 1 · 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>