r/opencode • • 26d ago

Newbie question about opencode

I got ollama and opencode installed. All in terminal so far. Gemma4 model seems to run on my GPU. I couldn't find a default config file, so I'm slowly building one from scratch.

My opencode.jsonc:

{

"$schema": "https://opencode.ai/config.json",

"model": "gemma4:latest",

"shell": "/bin/bash",

"default_agent": "build",

"update": "notify",

"websearch": {

"provider": "random",

},

"permission": {

  "question": "deny",

  "questions": "deny",

  "read": "allow",

  "write": "allow",

  "websearch": "allow",

}

}

I'm unsure whether websearch works or not, but it doesn't spit an error out, so I assume it does. Anyway, I'm not getting the final result output. Sample session log:

Prompt: what is your status?

  • Thought - 5.5s

"I am an AI assistant, and I am currently operational and ready to assist you with any questions or tasks you have."

Prompt: what is the current price of tesla stock?

  • Thought - 7.1s
  • Explored: 1 search
  • Thought - 1.2s

"I am ready to help. Please tell me what you would like me to do."

I would like to provide more info from the session log, but it is completely breaking copy/paste for me in the terminal (different issue and not the point of this post). The point is that even though it looks the price up, it refuses to print the result. Some text from the 2nd thought:

"The user has not provided any prompt or request yet. I need to wait for the user to give me a task so that I can decide which tool use"

Granted, I didn't specifically tell it what to do with the tesla stock price, but shouldn't it just print it out by default? Even if I tell it to print it out, it will refuse like it's some state secret. There is also another thought (error?) it spits out once in a while:

"No tool named "questions" is currently available. Please use a tool from the availalble tool list."

But for this error I have to allow "question" in the config instead of deny.

It's getting long already, so I'll stop here even though it's an uphill battle for me.

1 Upvotes

8 comments sorted by

1

u/v_0009 26d ago

Did you try some of free opencode models and let them write the config for you? Harnesses can do that these days. It should ask you for permission to edit it and configure however you tell it.

1

u/bizgob 26d ago edited 26d ago

No I have not. Does this mean I can only use opencode models? Can I switch back again? I thought all this stuff was part of the installation procedure. I suspect there's more missing from installation. I tried the /init command and that failed also.

1

u/v_0009 26d ago

You can use any model. And ofc you can switch back again. I wouldn't say it is part of installation procedure. You just install it and it works. Optionally login with providers like opencode go or add your own provider.

My point was that it is easier to ask a free opencode model (available to everyone) is easier or it would help you kickstart your config at least. 🙂

1

u/bizgob 26d ago

Thanks. I'm new to this. I'm old school, where we had some default config files to start out with.

1

u/v_0009 26d ago

Yea no worries. You will get used to it.

1

u/bizgob 25d ago

I just want to thank you again for pointing me in the right direction. I went back to read in the install instruction and this was not part of it.

In pure frustration I switched /model to Pickel or something and then asked it if it can fix my config file. After doing a bit of this and that, it all started to work.

However, switching back to gemma4 breaks it all. So it seems I have to start seaching for an alternative model.

1

u/CreativeSympathy8293 26d ago

You can keep using Ollama. First choose its model from /models. If you set a default in the config, use the full provider/model ID shown there: gemma4:latest alone is only the model part. V2's locally discovered Ollama models use ollama/...: https://opencode.ai/v2/docs/models/

Check your OpenCode version before copying a replacement config. Your update and websearch.provider fields match V2 docs, while permission uses the V1 shape. V2 still supports V1 syntax, so that difference alone doesn't establish why the answer goes missing: https://opencode.ai/v2/docs/migrate-v1/

I'd narrow the output problem in a fresh session with the selected local model:

  • Ask “Without tools, reply with the word READY.” Does a final answer appear?
  • If it does, ask it to search for one public documentation page and summarize the result. Expand the search tool's output: did it return page content, an error, or nothing? “Explored: 1 search” alone doesn't show that a useful result reached the model.

The questions error means that requested tool name wasn't available; adding a permission entry doesn't create a tool. I wouldn't broaden file-write permissions to fix this.

Please include the OpenCode/Ollama versions, selected model ID, and redacted tool result plus final response. Those would help distinguish configuration, tool-return handling and model behavior.

AI-assisted from the docs; I haven't reproduced your setup.

1

u/bizgob 25d ago edited 25d ago

Thanks. Still trying to figure things out. Here's a bit more info:

ollama --version

ollama version is 0.40.4

opencode --version

opencode v2.2.5

ollama list

NAME ID SIZE MODIFIED
gemma4:latest dc35e8d9c606 6.6 GB 4 days ago

There's more in the list but so far I feel it's irrelevant. I don't feel like expanding the problem.

As for the websearch I haven't really picked anything other than setting it to random and allowing it under permissions.

So far I think there's 3 things to check:

  1. Making sure there's no v1 v2 mismatch in the config
  2. Checking whether the gemma4 model is actually suitable for this
  3. Try to see if I can somehow make it help me with proper config files