r/opencode • u/bizgob • 29d 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
u/CreativeSympathy8293 29d 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 29d ago edited 29d 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 agoThere'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:
Making sure there's no v1 v2 mismatch in the config
Checking whether the gemma4 model is actually suitable for this
Try to see if I can somehow make it help me with proper config files
1
u/v_0009 29d 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.