Skip to content

Models provided via ollama always respond that are read-only #2362

Closed

Description

@WJKPK

I'm using following versions of opencode and ollama

$ opencode --version
0.5.28
$ ollama --version
ollama version is 0.11.4

Here is my config.

Image

It look similar for both - devstral & gpt-oss models. If i try to generate /init it also fails in similar way. Last message from screenshot is from grok and this agent is working properly. Messages about read-only mode are independent from mode chosen in TUI (plan/build/review).

How can I provide you more verbose information to help?

Activity

  1. github-actions commented on Sep 1, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These issues all describe similar symptoms where Ollama models appear to generate tool calls but they don't execute properly, which could manifest as the "read-only" behavior you're experiencing.

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Sep 1, 2025

    @rekram1-node
    Contributor

    Hm you may need to set "tool_call": true in your opencode.json, can you share yours by chance?

    ex:

    "provider": {
        "ollama": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Ollama (local)",
          "options": {
            "baseURL": "http://localhost:11434/v1"
          },
          "models": {
            "llama2": {
              "name": "Llama 2",
              "tool_call": true
            }
          }
        }
      }
    
  3. WJKPK commented on Sep 2, 2025

    @WJKPK
    Author

    I already added my config. Add tool_call helped, but models now have problems with tool calling.

    Image

    Should we continue here, or should I create new issue?

  4. rekram1-node commented on Sep 2, 2025

    @rekram1-node
    Contributor

    you may have to prompt for that, most models don't have that issue and you are using a pretty small model there

  5. WJKPK commented on Sep 2, 2025

    @WJKPK
    Author

    I tried prompting, I tried fixes from #1068 - it doesn't work. I need a tool that works well with local models. Sincere thanks for the open source tool, but my use case is not really supported.

  6. rekram1-node commented on Sep 2, 2025

    @rekram1-node
    Contributor

    I have heard people get 20b working so I will try to get back to you on if they did anything special

  7. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Contributor

    Can you set OLLAMA_CONTEXT_LENGTH=12288 I heard some people say ollama basically doesnt work without it in many cases

  8. johnjelinek commented on Sep 3, 2025

    @johnjelinek

    note: you may need to tweak the context based on your available memory. 8192 is a good starting point and then increment by 1024 until you get something that works (or memory runs out).

  9. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Contributor

    thank you @johnjelinek for jumping in!

  10. WJKPK commented on Sep 3, 2025

    @WJKPK
    Author

    Hmm, great! After set up of this variable it started working with gpt-oss.
    As I am a Nix user, for those interested, here is my ollama with nvidia GPU declaration.

      services = {
        ollama = {
          enable = true;
          package = pkgs.ollama-cuda;
          acceleration = "cuda";
          environmentVariables = {
            OLLAMA_CONTEXT_LENGTH = "16384";
          };
        };
    
    Image
  11. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Contributor

    thank you both of you I will try to point people here if they encounter ollama issues local inference issues

  12. johnjelinek commented on Sep 3, 2025

    @johnjelinek

    I think this mustn't be unique to ollama. I'd be surprised if you didn't have to set the context window likewise in llama-server

  13. MarvAmBass commented on Oct 31, 2025

    @MarvAmBass

    thanks so much OLLAMA_CONTEXT_LENGTH=12288 fixed the issue on my machine

  14. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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