Skip to content
← Back to activity

Public problem

Qwen3 tool calls not parsed into AIMessage.tool_calls on OCI

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

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.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

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

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