r/opencode • u/bizgob • 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
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/CreativeSympathy8293 26d ago
You can keep using Ollama. First choose its model from
/models. If you set a default in the config, use the fullprovider/modelID shown there:gemma4:latestalone is only the model part. V2's locally discovered Ollama models useollama/...: https://opencode.ai/v2/docs/models/Check your OpenCode version before copying a replacement config. Your
updateandwebsearch.providerfields match V2 docs, whilepermissionuses 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:
The
questionserror 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.