Skip to content

Opencode + dockerized ollama getting stuck after first prompt #25352

Description

@lopeztel

Description

Running docker container with ollama, managing through openwebui.

OS: Bazzite
Opencode version: 1.14.31

Problem:
I have tried to use both qwen3.5:9b and qwen3.5:4b locally with the same results, the first prompt requires running command ls in the current directory. After reasoning that ls must be ran, the model stops execution fully without executing anything, furthermore all context is forgotten.

Expected behavior:
running commands in the current directory and being able to remember the context.

Settings:

{
  "$schema": "https://opencode.ai/config.json",
  "default_agent": "plan",
  "compaction": {
    "auto": true,
    "prune": true,
    "reserved": 8192
  },
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama (local)",
      "options": {
        "baseURL": "http://localhost:11434/v1"
      },
      "models": {
        "qwen3.5:9b": {
          "name": "qwen3.5:9b_ext",
          "_launch": true,
          "tool_call": true,
          "options":{
            "temperature": 0.1
          },
          "maxTokens": 16384
        },
        "qwen3.5:4b": {
          "name": "qwen3.5:4b_ext",
          "_launch": true,
          "tool_call": true,
          "options":{
            "temperature": 0.1
          },
          "maxTokens": 16384
        },
        "gemma4:e4b": {
          "name": "gemma4:e4b_ext",
          "_launch": true,
          "tool_call": true,
          "options":{
            "temperature": 0.1
          },
          "maxTokens": 16384
        }
      }
    }
  },
  "permission":{
    "read": "allow"
  }
}
  • I have modified parameter num_ctx in openwebui to be 65536:
Image

I'm happy to help with more info if needed. Feel free to point me in the right direction if I missed something

Plugins

No response

OpenCode version

1.14.31

Steps to reproduce

  1. deploy ollama in docker (AMD rocm)
  2. deploy openwebui in docker to download models (qwen3.5:4b used in example but 9b has the same problem)
  3. in openwebui, go to workspace->new model->select base model (previously downloaded qwen3.5:4b)->advanced params -> show, modify num_ctx = 65526
  4. Modify opencode config json
  5. run opencode in any directory, select the corresponding model, change to build, ask it to do ls in the current directory or list its contents

Screenshot and/or share link

Image

Operating System

Bazzite

Terminal

Konsole

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions