You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ollama (qwen2.5-coder): tool calls (edit/write) show as executed but no files are created/modified #7030
When using OpenCode with Ollama + qwen2.5-coder, tool calls such as edit / write appear to execute (the JSON tool payload is printed in the output), but no files are actually created or modified on disk.
This affects both /init (which does not create AGENTS.md) and any manual request to create or edit files. Manual file creation using the shell works, confirming the directory is writable. The issue reproduces consistently across sessions and directories.
It appears that tool calls are generated by the model, but are not applied to the filesystem.
Plugins
No response
OpenCode version
1.1.3
Steps to reproduce
cd into a writable directory (verified with touch test.txt)
Start OpenCode from that directory: opencode
Ask OpenCode to create a file, for example:
"Create a file named prueba.txt"
Alternatively, run: /init
OpenCode prints a tool call (edit / write), but no file is created on disk.
Yes. This is using Ollama (local) with qwen2.5-coder via the OpenAI-compatible endpoint (http://127.0.0.1:11434/v1). The issue reproduces consistently when using Ollama as the provider.
Ill try to do a pass on ollama soon but rn u need to configure that cause ollama by default has such a low context limit that agentic stuff will hardly work
Ask the model what the function signature of the write tool is. It will tell you garbage like filepath followed description, while it is content followed by filepath. If you explain it, it does it correctly, keeps forgetting.
I'm having the same issue with my qwen2.5 models hosted in local Docker Ollama. Ollama context is set to 32K (env var OLLAMA_CONTEXT_LENGTH=32768) and verified via Open WebUI.
If I select qwen2.5-coder:14b-instruct-q4_K_M model in build agent and ask what is the function signature of the write tool? I get
The write tool function signature is as follows:
{
name: write,
arguments: {
filePath: /path/to/file,
content: Content to write into the file
}
}
- filePath (string): The absolute path where the file should be created or overwritten.
- content (string): The content to write into the specified file.
When you call this tool with the appropriate arguments, it will create or overwrite the file at the provided filePath with the specified content.
After my issues with Ollama I just installed Llama.cpp and I can reproduce the same issue. So the problem seems to be either OpenCode, either the qwen2.5 models.
I managed to completely solve this issue when using local models via Ollama (like Qwen, Phi-4, or GPT-OSS) in my WSL/VS Code setup.
The Problem:
Local OSS models often lack the strict structural obedience to use the file_editor tool correctly unless explicitly forced via a strong SYSTEM prompt. Just pulling the base model and setting "tools": true in the config is usually not enough; they either hallucinate the tool name or output plain text instead of triggering the actual tool execution.
The Solution:
Here is the step-by-step guide to fixing it by creating a custom "Agent" model in Ollama:
Step 1: Create a Master Agent Modelfile
Create a file named MasterAgent.mf in your terminal. This prompt forces the model to respect the tool schema provided by OpenCode, stops laziness, and optimizes the context window.
# Context window (adjust based on your RAM/VRAM)
PARAMETER num_ctx 16384
PARAMETER temperature 0.2
PARAMETER top_p 0.9
PARAMETER top_k 40
SYSTEM """You are an elite Senior Software Engineer and AI Assistant. Your primary goal is to provide highly capable, accurate, and complete programming assistance.# TOOL USAGE & ENVIRONMENTYou have access to environment-provided tools to read files, write files, and execute commands.- ALWAYS use the exact tool schemas and formats explicitly provided by your current environment (e.g., OpenCode, VS Code, or Cline).- Do not invent or hallucinate tool names. - All file paths should be relative to the current active workspace directory, unless an absolute path is requested.- When asked to modify or create a file, execute the tool call immediately. Do not just explain how to do it in plain text.# CODING STANDARDS- Write clean, production-ready, modular, and well-documented code.- NO LAZINESS: Never output incomplete code, avoid placeholders like '... (rest of the code)'. Always write the full modified block or file.- Before making complex architectural changes, briefly output a 'thinking' process to plan your steps, then execute the necessary tools."""
Step 2: Compile the Custom Agent Model
Combine your base model (e.g., Qwen 2.5 Coder or Phi-4) with this new Modelfile. Run this in your terminal:
# 1. Pull your preferred base model
ollama pull qwen2.5-coder:14b
# 2. Create a specific Modelfile for itecho"FROM qwen2.5-coder:14b"> Modelfile-qwen
cat MasterAgent.mf >> Modelfile-qwen
# 3. Compile the new tool-enabled agent
ollama create qwen-agent -f Modelfile-qwen
Step 3: Update opencode.json
Now, map this newly created qwen-agent in your OpenCode configuration file (usually located at ~/.config/opencode/opencode.json). Make sure to use the @ai-sdk/openai-compatible provider and explicitly set "tools": true.
Restart your OpenCode session. The model should now reliably use the file_editor tool, generate the "Thinking" blocks, and apply file patches successfully without throwing the "Skill 'file_editor' not found" error.
(Note: You can apply this exact same fix to phi4, gpt-oss, or any other reliable coding model by changing the base model in Step 2).
Hope this helps anyone struggling with local setups! 🚀
Followed this instruction and managed to get my qwen2.5-coder:3b to create a simple file, however when prompted to create multiple files, it somehow insists on printing instructions rather than creating actual files
Activity
github-actions commentedon Jan 6, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Jan 6, 2026
Is this w/ ollama?
danielveraec commentedon Jan 6, 2026
Yes. This is using Ollama (local) with
qwen2.5-codervia the OpenAI-compatible endpoint (http://127.0.0.1:11434/v1). The issue reproduces consistently when using Ollama as the provider.rekram1-node commentedon Jan 6, 2026
Did u set num_ctx (see docs)
Ill try to do a pass on ollama soon but rn u need to configure that cause ollama by default has such a low context limit that agentic stuff will hardly work
GlenM42 commentedon Jan 6, 2026
Same problem. Increasing the context size in the Ollama settings appears to solve the issue:
UPD. Sorry for misleading. Worked once, but can't make it to work since
dwhacks commentedon Jan 29, 2026
Even making qwen2.5-coder have a 20k or more context length it doesnt seem to be able to actually create/edit files:
create a python script that will convert user input text into sha-256 checksumecho -n "Enter the text to convert: "read textecho -ne "$text" | openssl dgst -sha256This script prompts the user for text input and then uses openssl to compute the SHA-256 checksum of the provided text.It writes out the steps as if its doing it, but doesnt do it. Qwen3 will work with all the same settings.
torgeir commentedon Feb 8, 2026
I'm seeing the same thing.
allarac commentedon Feb 13, 2026
Ask the model what the function signature of the write tool is. It will tell you garbage like filepath followed description, while it is content followed by filepath. If you explain it, it does it correctly, keeps forgetting.
Stolz commentedon Feb 20, 2026
I'm having the same issue with my qwen2.5 models hosted in local Docker Ollama. Ollama context is set to 32K (env var
OLLAMA_CONTEXT_LENGTH=32768) and verified via Open WebUI.If I select
qwen2.5-coder:14b-instruct-q4_K_Mmodel inbuildagent and askwhat is the function signature of the write tool?I getThe Ollama logs don't show any error nor warning
currymike123 commentedon Feb 23, 2026
I'm having the same issue with Ollama and OpenCode running qwen2.5-coder:14b-instruct with a 32k context window. Any suggestions?
Stolz commentedon Feb 24, 2026
After my issues with Ollama I just installed Llama.cpp and I can reproduce the same issue. So the problem seems to be either OpenCode, either the qwen2.5 models.
aburlot commentedon Mar 4, 2026
Having the same issue with
qwen2.5-coder:lateston ollama, but it worked withdevstral-small-2:latest. So my 2 cents are on the model.lawrenehi commentedon Mar 18, 2026
having the same issue with llama.cpp, only qwen3 works, deepseek just says
i dont have permissionand qwen2.5 acts as above.davidrudlstorfer commentedon Mar 31, 2026
@danielveraec I am experiencing exactly the same behaviour, have you found any solution to that?
Nightro commentedon Apr 9, 2026
Same thing over here!
nilo85 commentedon Apr 16, 2026
I have the same behaviour
adlbgr commentedon Apr 17, 2026
me either :( any solutionS?
the-webguys commentedon Apr 19, 2026
At the risk of getting your hopes up, I have been working on this for a while and a workaround MAY be imminent...
Just some final testing and i shall post it publicly for everyone, as a few are also struggling with IDE -> llama-server issues and tools
I successfully got a test for File creation when setting (in:
opencode.jsonc):and then,
This produced: ALLOW or DENY options.
Image of the first success...
I'm NOT jumping around my living room, YOU ARE!
the-webguys commentedon Apr 22, 2026
I finally got time to finalise and publish the Repo...
If anyone is still having issues with Tools NOT communicating, Check out the tool i made to help with this Exact issue, i would love some feedback...
https://github.com/the-webguys/llama-BridgeAI
jdjinete commentedon May 2, 2026
I managed to completely solve this issue when using local models via Ollama (like Qwen, Phi-4, or GPT-OSS) in my WSL/VS Code setup.
The Problem:
Local OSS models often lack the strict structural obedience to use the
file_editortool correctly unless explicitly forced via a strongSYSTEMprompt. Just pulling the base model and setting"tools": truein the config is usually not enough; they either hallucinate the tool name or output plain text instead of triggering the actual tool execution.The Solution:
Here is the step-by-step guide to fixing it by creating a custom "Agent" model in Ollama:
Step 1: Create a Master Agent
ModelfileCreate a file named
MasterAgent.mfin your terminal. This prompt forces the model to respect the tool schema provided by OpenCode, stops laziness, and optimizes the context window.Step 2: Compile the Custom Agent Model
Combine your base model (e.g., Qwen 2.5 Coder or Phi-4) with this new
Modelfile. Run this in your terminal:Step 3: Update
opencode.jsonNow, map this newly created
qwen-agentin your OpenCode configuration file (usually located at~/.config/opencode/opencode.json). Make sure to use the@ai-sdk/openai-compatibleprovider and explicitly set"tools": true.{ "$schema": "[https://opencode.ai/config.json](https://opencode.ai/config.json)", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama local", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "qwen-agent": { "name": "Qwen 14B Agent", "tools": true } } } } }Step 4: Restart
Restart your OpenCode session. The model should now reliably use the
file_editortool, generate the "Thinking" blocks, and apply file patches successfully without throwing the "Skill 'file_editor' not found" error.(Note: You can apply this exact same fix to
phi4,gpt-oss, or any other reliable coding model by changing the base model in Step 2).Hope this helps anyone struggling with local setups! 🚀
torgeir commentedon May 2, 2026
Followed steps as described, this did not work for me @jdjinete
Jaydonchong commentedon May 7, 2026
Followed this instruction and managed to get my qwen2.5-coder:3b to create a simple file, however when prompted to create multiple files, it somehow insists on printing instructions rather than creating actual files
feat(opencode): live tool-calling probe; skip tool-less models in aut…
github-actions commentedon Jul 8, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.