tool_call was output as text, not executed. #976

Closed
opened 2026-02-16 17:28:58 -05:00 by yindo · 12 comments
Owner

Originally created by @MyGodOnLoad on GitHub (Jul 29, 2025).

Originally assigned to: @thdxr on GitHub.

system platform:Docker + Ubuntu22.04 arm64
model platform:Mindie
model:qwen2.5:14B
the way to install opencode: curl -fsSL https://opencode.ai/install | bash

opencode.json

{
    "$schema": "https://opencode.ai/config.json",
    "provider": {
        "ollama": {
            "npm": "@ai-sdk/openai-compatible",
            "options": {
                "baseURL": "http://host.docker.internal:19067/v1"
            },
            "models": {
                "qwen2.5:14b": {
                    "tools": true
                }
            }
        }
    }
}

output:
<tool_call>{"name":"write", "arguments": {"filePath":"fast_sort.py", "content": "here is code content"}}</tool_call>

question:tool_call was output as text, tool was not executed.

Originally created by @MyGodOnLoad on GitHub (Jul 29, 2025). Originally assigned to: @thdxr on GitHub. system platform:Docker + Ubuntu22.04 arm64 model platform:Mindie model:qwen2.5:14B the way to install opencode: curl -fsSL https://opencode.ai/install | bash opencode.json ```json { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://host.docker.internal:19067/v1" }, "models": { "qwen2.5:14b": { "tools": true } } } } } ``` output: `<tool_call>{"name":"write", "arguments": {"filePath":"fast_sort.py", "content": "here is code content"}}</tool_call>` question:tool_call was output as text, tool was not executed.
yindo added the model-problem label 2026-02-16 17:28:58 -05:00
yindo closed this issue 2026-02-16 17:28:58 -05:00
Author
Owner

@thdxr commented on GitHub (Jul 29, 2025):

these small local models do not work well with opencode

@thdxr commented on GitHub (Jul 29, 2025): these small local models do not work well with opencode
Author
Owner

@MyGodOnLoad commented on GitHub (Jul 29, 2025):

these small local models do not work well with opencode

But VSCode plugin Cline uses the same model and can correctly use tools as expected.

@MyGodOnLoad commented on GitHub (Jul 29, 2025): > these small local models do not work well with opencode But VSCode plugin Cline uses the same model and can correctly use tools as expected.
Author
Owner

@ggaabe commented on GitHub (Jul 30, 2025):

@thdxr this was working with devstral as of a little over a week ago but suddenly isn't working now. I'm wondering if this might be a newly reintroduced bug

nvm: this may be because the config changed from requiring tool_calls to just tools. changed it to this and it worked.

@ggaabe commented on GitHub (Jul 30, 2025): @thdxr this was working with devstral as of a little over a week ago but suddenly isn't working now. I'm wondering if this might be a newly reintroduced bug nvm: this may be because the config changed from requiring `tool_calls` to just `tools`. changed it to this and it worked.
Author
Owner

@MyGodOnLoad commented on GitHub (Jul 30, 2025):

@ggaabe should change "tool_calls" to "tools" in the source code ?

@MyGodOnLoad commented on GitHub (Jul 30, 2025): @ggaabe should change "tool_calls" to "tools" in the source code ?
Author
Owner

@MyGodOnLoad commented on GitHub (Jul 30, 2025):

@thdxr Is this format correct?
<tool_call>{"name":"write", "arguments": {"filePath":"fast_sort.py", "content": "here is code content"}}</tool_call>

@MyGodOnLoad commented on GitHub (Jul 30, 2025): @thdxr Is this format correct? `<tool_call>{"name":"write", "arguments": {"filePath":"fast_sort.py", "content": "here is code content"}}</tool_call>`
Author
Owner

@ggaabe commented on GitHub (Jul 30, 2025):

@MyGodOnLoad No, only in your config file. There probably should have been a migration for this

@ggaabe commented on GitHub (Jul 30, 2025): @MyGodOnLoad No, only in your config file. There probably should have been a migration for this
Author
Owner

@taxilian commented on GitHub (Jul 30, 2025):

What exactly needs to be put in the config file to make this work? I'm seeing the same issue, trying to use GLX 4.5; it clearly thinks it can use a tool call, but it isn't what is expected. I can see in LM studio the prompt that is telling it how to do that, though I'd have though opencode would override the default system prompt to work differently... but either way, I could probably change the default system prompt in lm studio for that model but I don't know what it should be.

Searched the docs, can't find anything... any direction would be appreciated =]

@taxilian commented on GitHub (Jul 30, 2025): What exactly needs to be put in the config file to make this work? I'm seeing the same issue, trying to use GLX 4.5; it clearly thinks it can use a tool call, but it isn't what is expected. I can see in LM studio the prompt that is telling it how to do that, though I'd have though opencode would override the default system prompt to work differently... but either way, I could probably change the default system prompt in lm studio for that model but I don't know what it should be. Searched the docs, can't find anything... any direction would be appreciated =]
Author
Owner

@ggaabe commented on GitHub (Jul 30, 2025):

@taxilian this is my exact config I'm using (your exact model identifier may be different, there are several GLM-4.5 air MLX variants already):

"glm-4.5-air-hi-mlx": {
  "name": "GLM-4.5 Air Hi 4Bit",
  "reasoning": true,
  "tools": true
}
@ggaabe commented on GitHub (Jul 30, 2025): @taxilian this is my exact config I'm using (your exact model identifier may be different, there are several GLM-4.5 air MLX variants already): ``` "glm-4.5-air-hi-mlx": { "name": "GLM-4.5 Air Hi 4Bit", "reasoning": true, "tools": true } ```
Author
Owner

@ionizing-plasma commented on GitHub (Jul 30, 2025):

So, when I put "tool_call": true, I don't see a schema error in the editor (zed). When I switch it to "tools", I get a schema error saying "Property tools is not allowed." I take it we are to ignore schema errors? What is the point of the schema then..

Honestly I didn't even have any form of a tool tag in my opencode.json and my local models where going ahead with tool use regardless. Of course, this morning the new qwen3-30b-a3b pretended it didn't have tool use until I told it explicitly, then it proceeded just fine in opencode. So I thought maybe I should add this "tools": true line as you all are discussing. Anyhow I will just try it I suppose.

@ionizing-plasma commented on GitHub (Jul 30, 2025): So, when I put "tool_call": true, I don't see a schema error in the editor (zed). When I switch it to "tools", I get a schema error saying "Property tools is not allowed." I take it we are to ignore schema errors? What is the point of the schema then.. Honestly I didn't even have any form of a tool tag in my opencode.json and my local models where going ahead with tool use regardless. Of course, this morning the new qwen3-30b-a3b pretended it didn't have tool use until I told it explicitly, then it proceeded just fine in opencode. So I thought maybe I should add this "tools": true line as you all are discussing. Anyhow I will just try it I suppose.
Author
Owner

@Syazvinski commented on GitHub (Jul 31, 2025):

Having same issue with Qwen model, that im running locally. It seems that the qwen 3 tool parser needs to be integrated for qwen coder models to work well.

@Syazvinski commented on GitHub (Jul 31, 2025): Having same issue with Qwen model, that im running locally. It seems that the qwen 3 tool parser needs to be integrated for qwen coder models to work well.
Author
Owner

@MyGodOnLoad commented on GitHub (Aug 4, 2025):

@thdxr After testing, my issue is related to the model deployment platform: using Swift works fine, but using MinIE has this issue.

@MyGodOnLoad commented on GitHub (Aug 4, 2025): @thdxr After testing, my issue is related to the model deployment platform: using Swift works fine, but using MinIE has this issue.
Author
Owner

@taxilian commented on GitHub (Aug 5, 2025):

It does seem to be related to model deployment – I had to change the Prompt Template in LM Studio. Using "Manual" and ChatML mostly works, but not 100%.

While this isn't an opencode bug per se, it would be helpful if some guidance could be provided in the opencode docs indicating what format the tool call stuff should use

@taxilian commented on GitHub (Aug 5, 2025): It does seem to be related to model deployment – I had to change the Prompt Template in LM Studio. Using "Manual" and ChatML mostly works, but not 100%. While this isn't an opencode bug per se, it would be helpful if some guidance could be provided in the opencode docs indicating what format the tool call stuff should use
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#976