qwen2.5-coder is not able to execute any tools

Resolved 💬 7 comments Opened Aug 12, 2025 by cowwoc Closed Nov 24, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.21.0

Which model were you using?

qwen2.5-coder:14b

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

  1. Given this config.toml:
projects = { '[redacted]' = { trust_level = "trusted" } }

approval_policy = "on-request"
sandbox_mode    = "workspace-write"

[sandbox_workspace_write]
network_access = true

[model_providers.ollama]
name = "Ollama"
base_url = "http://127.0.0.1:11434/v1"

[profiles.ollama]
model_provider = "ollama"
model = "qwen2.5-coder:14b"
  1. set RUST_LOG=codex_core=debug,codex_tui=debug
  2. Run codex --profile ollama "List the files in the current directory"
  3. I get this output:
user List the files in the current directory codex {"name": "shell", "arguments": {"command": ["ls"]}}

I will attach the debug log file below.

What is the expected behavior?

Codex should execute the "shell" tool

What do you see instead?

The instruction is listed as part of the chat

Additional information

codex-tui.log

View original on GitHub ↗

7 Comments

BigMitchGit · 11 months ago

Why do you expect a 14b qwen-2.5 model to properly call your tools?

cowwoc · 11 months ago

@BigMitchGit Perhaps I am missing something fundamental here, but if online models can properly call the tools why wouldn't qwen2.5-coder be able to? I also tried https://ollama.com/hhao/qwen2.5-coder-tools but ran into similar problems.

What am I missing here?

BigMitchGit · 11 months ago

@cowwoc It's not about cloud vs local models

Most models are just really bad at tool calling. For the longest time only Claude models were decent at it, starting from Claude 3.5
Only very recently have other labs started catching up to it. Qwen 3 480b, Kimi K2, GLM 4.5 are some open-source examples of models that are decent at calling tools. As for openai, it's really only since gpt-5 that they're good at tool-calling.

I don't think there's any 14b model in the world right now that can call tools properly.

cowwoc · 11 months ago

@BigMitchGit But the model returns: {"name": "shell", "arguments": {"command": ["ls"]}}

Doesn't that imply that it is explicitly trying to invoke a tool but codex is not interpreting the response correctly?

BigMitchGit · 11 months ago

@cowwoc No.

The format that codex expects looks something like this

{
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": null,
      "tool_calls": [
        {
          "id": "call_abc123",
          "type": "function",
          "function": {
            "name": "shell",
            "arguments": "{\"command\":[\"ls\"]}"
          }
        }
      ]
    },
    "finish_reason": "tool_calls"
  }]
}

So either somehow Ollama put the tool call structure into the 'content' field, or Ollama just did a plain-text output instead of this structured output that Codex expects.

So the issue is with your LLM or Ollama backend, nothing to do with Codex as far as I know.

etraut-openai contributor · 7 months ago

This issue is stale, so closing.

DRunkPiano114 · 6 months ago

Going through same same question.
@BigMitchGit Thanks bro, inspired me a lot.