Skip to content

Opencode + Qwen gives JSON output instead of writing to disk #29757

@dvictori

Description

@dvictori

Description

I'm using OpenCode 1.15.11 with Qwen2.5-code:7b running with ollama on my desktop.

I asked for a simple python script, saved into a file. Instead of creating the file on disk, OpenCode returned the JSON for the write command.

Image

I'm using the build agent and here is my ./.config/opencode/opencode.jsonc. I understand that I have given all the necessary permissions to the model

{
    "$schema": "https://opencode.ai/config.json",
    "permission": {
	"edit": "ask",
	"bash": "ask",
	"webfetch": "allow",
	"read": "ask",
	"write": "ask"
    },
   "provider": {
       "ollama": {
	   "name": "ollama",
	   "npm": "@ai-sdk/openai-compatible",
           "options": {
               "baseURL": "http://localhost:11434/v1"
           },
           "models": {
      	       "qwen2.5:7b": { "name": "Qwen2.5 7b" },
      	       "qwen2.5-coder:7b": { "name": "Qwen2.5 Code 7b" },
	       "qwen3.5:9b": { "name": "Qwen3.5 9b" }
           }
       }
   }
}

Plugins

No response

OpenCode version

1.15.11

Steps to reproduce

  1. Install ollama and Qwen2.5-code:7b (using 16k context size)
  2. Instruct opencode/Qwen2.5 to create the file

Screenshot and/or share link

No response

Operating System

Ubuntu

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions