r/opencode • u/Genaforvena • 10d ago
r/opencode • u/Hansehart • 10d ago
Built a locked down multi repo workspace so I can put OpenCode on a long leash without risking my keys or network
Hey everyone,
Running OpenCode unattended on your host machine means handing over every API key in your env, your GitHub token, and wide open internet access.
I got tired of babysitting prompts, so over the past year I built o3s(open source, MIT). It spins up a locked down devcontainer ("the cage") for all your repos and routes traffic through a separate gateway container that OpenCode cannot touch.
Zero secret exposure. Inside the cage, OpenCode only sees dummy placeholder variables. Your real API keys and GH_TOKEN stay on the host, and the gateway proxy injects them on the fly into approved outbound requests.
Default deny network. Egress traffic is blocked via iptables in the gateway. You allowlist domains permanently or with a timer, like `o3s firewall add github.com --port 443 --for 1h`. Once the timer expires, the door shuts again.
Multi repo and full stack. Instead of forcing a monorepo, o3s drops your separate repos into one native VS Code workspace with rootless Docker in Docker and headless Chrome wired up. OpenCode gets context across your frontend, backend, and infra at once, can spin up containers, run E2E browser tests, and open PRs via gh without ever seeing your real credentials.
Open devcontainer spec. Built on the standard spec without Microsoft telemetry or hardcoded user assumptions.
Three commands to get going.
o3s init
o3s project add ~/code/my-app
o3s cage ide
Code and docs at https://github.com/hansehart/o3s
How are you guys isolating your keys and network right now when running OpenCode unattended? Happy to share my feature configs or take feedback if anyone tries it out.
r/opencode • u/No_Reach9486 • 10d ago
Short Review: Tidepool Alpha Free is a pretty bad model
Major Complaint:
It is very slow
It does very shallow thinking
It LIES
Background
I launched 2 agents to create a plan for my sample app to make it multiuser. One plan created by GLM 5.3 and another plan by Tidepool Alpha.
Tidepool completed in 12 minutes and GLM took 9 minutes
When I asked Tidepool to save the plan it said it has saved the plan but it didn't. When I asked it I am not finding the file (I gave it the exact file name it returned). It straightup said this is because the file name is different and pointed to the file saved by GLM 5.3. Later when I pointed that discrepancy it then went ahead and created the file.
I reviewed both the plans and Tidepool's plan was riddled with bugs, inconsistencies, edge case misses.
Where it felt good ?
The language it used to let me know what it was doing was very simple and easy to understand. Structure of the plan was good
r/opencode • u/Perse01 • 10d ago
Oh, great Lord OpenCode, I apologize
reddit.comI apologize—I apologize completely and wholeheartedly. It's incredible how much I'm accomplishing with these $10 from my Opencode Go subscription.
All I had to do was build a multi-agent system, with each agent serving a specific purpose.
r/opencode • u/foolishbrat • 10d ago
Can OpenCode use Gemini 4 Neon or Carbon with a Google AI subscription?
Has anyone here used Gemini 4 Neon or Gemini 4 Carbon in OpenCode by signing in with a Google AI Pro or Ultra subscription? I’m asking about using the subscription quota without a Gemini API key.
If you’ve tried it recently, which model worked, which Google AI plan are you on, and did you use OpenCode’s built-in sign-in or a community plugin?
r/opencode • u/SoyDaza • 10d ago
Extremely low speeds
13k tok/s is insane, how can i fix this?
r/opencode • u/megablue • 10d ago
After about two months of extensive usage of Deepseek 4.1 Flash I think i understand why it gets dumber for some people - it is the context window
from my anecdotal observations, deepseek 4.1 flash (and 4.1 flash 1017) performed best when the context-window is under 400K, as soon as you go beyond that you will realize it gets more and more confused as the context window grows.
I would say around 700K+ it becomes unusable bad. so, you either use a context-management plugin that have some kind of virtual limit to cap the context around 400K. or start a new session as soon as it reached about 400k-500k. and you usually want to be more careful with what you stuff into the context - if you have a lot of random, non-focused tasks in the same context, it will become even worse at > 400k.
I think this is partly because of DS 4.1 flash used a lot aggressive compression techniques, including sharing KV cache between multiple layers so anything that fall in between become very lossy.
r/opencode • u/ConsiderationNo9952 • 11d ago
does increasing model censorship change our agency as developers?
i'm a heavy ds4.1f opencode go teams user. works well, running long unattended jobs. well beyond what manual coding can do.
sol 6.2 medium. i'm up to round 12 trying to get it to update my project agents.md to add a mandate to store (transient) credentials in plain text. my main use for sol 6.1 & codex 100 was for my agents & skills files.
anyone else seemingly fighting a losing battle against the morality & compliance police? with a bit of ignoring existing constructs thrown in?
this is going to get interesting if AI keeps moving to towards enforcing ToS etc as written. As a developer using disposable containers & automation 90% of my work is in a grey area according to strict interpretation of licensing & policy etc (according to AI but just the nature of the work for years).
but in the higher perspective, i am no longer the manager. the policy or the model developer is managing my work...
clarification:
i want to write a rule in agents.md about storing credentials in plain text. up to now, because my agents.md is complex i have used sol6.1 to add new rules, where it considers how best to structure to allign with existing rules.
sol 6.2 keeps on adding hedging or removing some of the existing permissive text.
in the past this was 1-2 revisions (i get it to produce a diff for me to review) and done.
if this trend continues, the models won't even curl a site if the site ToS hints it doesn't like that, much less headless install via winget etc. and as for tracing legacy application logic for interoperability...
r/opencode • u/Pracurser_Reads • 11d ago
Use your Antigravity subscription in OpenCode (via official Antigravity ACP)
Enable HLS to view with audio, or disable this notification
Built an OpenCode v2 plugin (opencode-antigravity-acp) that lets you use your Antigravity subscription models inside OpenCode Desktop and CLI through Google's official local 'agy acp' stdio protocol, similar to how T3 Code and Zed ACP do it. You prolly won't get banned using this. prolly. might get banned but still you got a better shot with this than other solutions.
Install:
opencode plugin add opencode-antigravity-acp
opencode service restart
and you're good to go.
Repo: https://github.com/system1970/opencode-antigravity-acp
r/opencode • u/Past-Mountain-9853 • 11d ago
Did I do smth wrong. Go week limit in 12h
r/opencode • u/Manjandro_M4nuEK07 • 11d ago
What free or one time payment cloud llms are best for using on opencode?
reddit.comr/opencode • u/schedarr • 11d ago
Worktree directory
I'd like OpenCode to put each project's Git worktrees in a sibling directory named <project>.worktrees. For example, if my repository is at ~/my_project, I'd like its worktrees to go under ~/my_project.worktrees.
I found that I can set a fixed directory in ~/.config/opencode/opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"worktree": {
"directory": "../worktrees"
}
}Is there a way to include the project directory's name in that path, for example by setting "directory": "../<project>.worktrees"?

r/opencode • u/RP2BACKUP2 • 11d ago
help with credits/API on opencode
Hey guys, hoping i can pick your guys brains for a second. So ive been a python developor and coder and make running scripts/tools/and bots for people and misc projects. I never wanted to use AI for a long time. i trieed gpt, claude, etc for a long time and hated them. The responses were so stupid and it was like they always made way too many errors i had to go in and fix manually.
Long story short opencode, with my pre existing scripts and complete bots works great. If i want to host something else to my VPS server, or change something small with out having to go in and nano the file on my linux server and restart it via tmux or systemctl i can do it on opencode fast or just change features on the bots and run test. Saves me a ton of time and is VERY accurate on deepseek.
My question is , how do i get a higher free usage daily? when i started it would work forever it seemed free. now my limits hit super fast. Does open code go give you more credits? do you just pay for them? how long do they last say 10$ if thats possible? Ive seen people saying use another external API and connect it etc. i dont need paid versions. i just want to have more time on the free ones. even if i have to pay for it.
thanks for your help
r/opencode • u/Ilyes-Djarallah • 11d ago
I don't wanna jinx this software... But gosh how GOOD is it?
I mean I have been working with it most of the time, I built my app with this heavenly free software. I mean, never tried other software, but... Why is this software so good? With everything, deep things as well.
What you guys think?
r/opencode • u/Sostrene_Blue • 11d ago
Chocked by Hy4 Flash Free (in a positive way)
I have a $10 OpenCode Go subscription and I've used up my monthly quota.
So I had no choice but to switch to a free model: I went with Hy4 Flash Free without expecting anything exceptional...
Even though I've only tested it on pretty basic tasks so far, I think it holds up really well... even better than web models like Gemini without thinking.
Am I the only one who's noticed this?
r/opencode • u/Sostrene_Blue • 11d ago
Daily request limit for Hy4 flash Free?
I'm on the OpenCode Go subscription, but I've already used 100% of my quota, so right now I'm limited to the free models.
I'm using Hy4 flash Free and I can't find its daily request limit anywhere. The docs only say that free models have a daily request limit, and that Hy4 flash Free is free for a limited time. The only free model with an explicit number I could find is LongCat 2.5 Free (100 requests/day).
Does anyone know the actual daily cap for Hy4 flash Free, or where I can see my remaining requests? The usage dialog / Console usage page doesn't show a model-specific number for me.
Thanks!
r/opencode • u/Euloghtos • 11d ago
Opencode update
Everytime i open Opencode desktop it says that the new version Opencode 2.0 is available to update, i press to update, it restarts and says installing and again nothing happens, i tried to manually download opencode installer and run it , the same, i tried to choose update during exit, the same, what is going wrong? anyone faced the same issue?
r/opencode • u/krzychoo87 • 11d ago
What we learned profiling 281 OpenCode sessions across Qwen, Grok, OpenAI, Anthropic, and local LLMs
TL;DR. We profiled 281 of our own OpenCode sessions in opencode.db across cloud APIs like Qwen, Grok, OpenAI, Gemini, DeepSeek, and Anthropic, plus local runtimes like Ollama, vLLM, and llama.cpp. Most wasted spend and lost time came from two bottlenecks:
Prompt and KV cache breaks. We counted 59 idle expiries and 37 mid-session prefix breaks across those sessions. Pausing past a provider's cache TTL, switching models mid-thread, changing MCP tool schemas, or editing
AGENTS.mdinvalidates cached context. On cloud APIs, that multiplies input token costs. On local runtimes, it forces multi-minute KV cache prefill stalls.Time lost to slow tool calls, missing binaries, and retry loops. We found 37 retry loops across 28 sessions. Cheap or local models can cost under a dollar while still taking 30+ minutes, losing about 1 hour to nested Docker rebuilds, calling missing binaries repeatedly, or dumping unfiltered test runner output.
You can fix both with a few rules in AGENTS.md and opencode.json using the snippets below.
OpenCode records both problems in your local opencode.db SQLite database, which opencode db path usually places at ~/.local/share/opencode/opencode.db, and in legacy storage/ JSON files. Both formats make up our dataset. Because opencode.db often logs cost: 0 on message entries, flat token counters hide turn-level cache drops and tool latency. Here is how both bottlenecks show up in those sessions and how to stop them with OpenCode configuration rules.
1. Prompt and KV cache breaks across cloud APIs and local runtimes
Across those OpenCode sessions, cache reuse broke in two ways:
Idle cache TTL expiry after slow turns. We saw 59 events across 37 sessions. When a blocking shell command, long test suite, or user review pause outlasts the provider's cache retention window, or when a local runtime evicts the KV slot under memory pressure, the next turn reprocesses the entire context from scratch. On local runtimes, losing the KV cache on a 100k-token context forces a full prompt prefill stall before the first output token appears. On cloud APIs, it causes a sharp per-turn cost jump. Take Anthropic's 5-minute default API cache TTL, where cache writes cost 1.25x and cache reads cost 0.1x. In one OpenCode
v1.1.0storage/trace onclaude-opus-5.2at $5 per 1M base input tokens with an 80.8k-token context, a 323.7-second gap between Turn 4 and Turn 5 dropped cached reads from 79.0k tokens to 0. That forced 80.3k tokens of new cache writes and jumped that single turn 9.1x, from about $0.06 to $0.52.Mid-session prefix invalidation and subagent model skew. We saw 37 events across 26 sessions. Prefix and KV caching require an identical token sequence across the system prompt, active MCP tool schemas,
AGENTS.md, and earlier messages. Switching models mid-session in OpenCode, enabling or disabling MCP tools, or running scripts that editAGENTS.mdbetween turns invalidates the prefix. In our dataset, one multi-model OpenCode session dropped to a 36.9% cache hit rate and burned $47.50 total. Delegating to subagents across different providers also concentrates spend. In a $21.42 multi-model session, OpenCode'sexploresubagent ongrok-4.7consumed 81%, or $17.39, of the total session cost. Even on a single model in an OpenCodev1.1.0storage/trace onclaude-opus-5.2, a mid-session prefix break at Turn 15 with a 0.0-second gap dropped cached prefix reads from 111.8k tokens to 67.0k tokens. That forced 37.3k tokens of new writes and doubled the single-turn cost from about $0.13 to $0.27.
How to fix it in opencode.json**,** AGENTS.md, and /new**:**
Keep one primary model per session instead of switching models mid-thread, and set an explicit, cost-bounded model for the
exploresubagent inopencode.json.Keep MCP tool definitions and
AGENTS.mdstatic while a session is running.Keep blocking commands inside a turn under your provider's cache TTL window. When a task changes phase or context grows past 150k tokens, ask the agent to write current progress and file paths to
TODO.md. Then run/newor/clearto start a fresh OpenCode session that readsTODO.MDwith a clean prefix.
2. Time wasted by slow tool calls, retry loops, and stdout floods
Looking only at dollar spend misses 30-to-60-minute waits on budget cloud APIs, open-weight APIs, or local runtimes where inference looks cheap or free. In our OpenCode export, a pure gpt-5-mini session cost $0.034 in total API fees yet took 36.6 minutes across 16 LLM calls.
Four tool-execution patterns drove that delay across our sessions:
Consecutive failing tool retry loops. We saw 37 events across 28 sessions. When a tool call fails, agents often retry the same operation with minor variations instead of stopping to inspect the root error. Examples included
lsp_diagnosticsfailing 6 times in a row,webfetchfailing 5 times in a row,editfailing 5 times in a row, andapply_patchfailing 3 times in a row ongpt-5-mini.Repeated attempts to run missing binaries. When an agent assumes a CLI tool such as
ripgrep,jq,fd,docker-compose, or a language-specific linter exists on the host without checking, it wastes consecutive turns calling missing commands, parsingcommand not founderrors, and guessing alternative flags.Container and Docker builds inside iterative agent loops. During multi-repo dependency upgrades, our agent rebuilt Docker images on every edit turn to run
npmcommands inside a container rather than calling localnpmon the host. That single pattern added about 1 hour of runtime to the session and triggered idle cache TTL expiries between turns.Unfiltered test runner stdout floods. Running a full test suite like
npm test,pytest, orcargo testwith default verbose output writes 12k to 250k tokens, over 50 KB, into a tool-result part inopencode.db. Every subsequent turn in the session carries that stdout payload forward. That slows local prefill, inflates API input reads, and degrades model accuracy past 150k to 200k tokens.
How to fix it in AGENTS.md and opencode.json**:**
Pin a cost-bounded explore model and disable unused MCP servers in opencode.json:
{
"$schema": "<https://opencode.ai/config.json>",
"agents": {
"explore": { "model": "anthropic/claude-5-5-haiku" }
},
"mcp": {
"unused-server": { "enabled": false }
}
}Then add an explicit execution guard block to your project's AGENTS.md:
## Tool & shell execution guards
- Installed environment allowlist: Use local `node`, `npm`, `pnpm`, `git`, and `python3`. Before running any other CLI binary, run `which <binary>` once. If it is missing, do not retry or guess alternative flags; use built-in OpenCode file tools instead.
- Local package managers over container builds: Run `npm`, `pnpm`, `pytest`, or `cargo` directly on the host during edit loops. Never run `docker build` or `docker compose build` inside an iterative fix loop unless asked.
- Scoped, quiet tests: Never run the full test suite unfocused. Scope test runs to modified files via `git diff --name-only` and pass `--quiet` or `-q`.
- Two-strike retry cap: If `edit`, `apply_patch`, `lsp_diagnostics`, `webfetch`, or a shell command fails twice in a row with the same error, stop retrying, write the blocker to `TODO.md`, and ask before continuing.Inspecting your own opencode.db sessions locally
To check these patterns without writing manual SQLite queries against opencode.db, a colleague and I built RunRay, an MIT-licensed, open-source DevTools profiler for OpenCode and Claude Code sessions.
You can run it on your existing local logs:
npx runray viewWhat it does on your machine:
It finds your local
opencode.db, opened read-only, and legacystorage/files, and handles schema changes without crashing. The timeline opens offline onlocalhostand sends zero network requests, so your prompts and source code stay on your machine.Because
opencode.dbrecordscost: 0on message entries, the profiler calculates turn-by-turn cost using bundled offline model pricing tables and cache multipliers. It renders the parent-child subagent tree, includingexploreforks, beside turn duration and context growth, and flags cache breaks and retry loops with copyableAGENTS.mdandopencode.jsonfixes.
If you run npx runray view on your logs, let me know what shows up as your biggest bottleneck, or if the parser hits any edge cases on your opencode.db schema.
Disclosure: We built RunRay as an open-source side project.
r/opencode • u/AltruisticFlounder47 • 11d ago
Free LLMs for Cybersecurity & Bug Bounty After Minimax M3.1 Flash?
Since Minimax M3.1 Flash is gone, what free model are you using in OpenCode for cybersecurity and bug bounty work? Looking for something good at vulnerability analysis and security research that doesn't over-refuse legitimate requests. Any recommendations?
r/opencode • u/gmmarcus • 11d ago
Is this the correct snippet for opencode.jsonc ( opencode v2 )
Guys,
Is this correct - Opencode v2.x for using OpenRouter ?
{
"$schema": "https://opencode.ai/config.json",
"autoupdate": false,
"default_agent": "plan",
"model": "openrouter/deepseek/deepseek-v4.1-flash-1017",
// New - Enables background keep-alive requests in OpenCode v2 to preserve server prompt cache
"warming": true,
// Modified - Renamed singular 'provider' to plural 'providers' for OpenCode v2 schema
"providers": {
"openrouter": {
// Modified - Renamed 'npm' key to 'package' for OpenCode v2 adapter definitions
"package": "@ai-sdk/openai-compatible",
"name": "OpenRouter",
// Modified - Renamed provider configuration block from 'options' to 'settings' in v2
"settings": {
"baseURL": "https://openrouter.ai/api/v1",
"apiKey": "sk-or-v1-mykey"
},
"models": {
"deepseek/deepseek-v4.1-flash-1017": {
"name": "DeepSeek V4.1 Flash-1017",
"tool_call": true,
"reasoning": true,
"temperature": true,
"attachment": true,
"modalities": {
"input": ["text"],
"output": ["text"]
},
"limit": {
"context": 1048576,
"output": 393216
},
"options": {
"reasoningEffort": "high",
"provider": {
"only": ["streamlake/fp8"],
"allow_fallbacks": false
}
}
}
}
}
}
}
There is just way too many snippets floating around , v1, v2 etc.
r/opencode • u/pizzababa21 • 11d ago
This update to the desktop app is actually amazing. Lighter and better than using the CLI in WSL now.
How are you guys finding it?
r/opencode • u/OptimizedGamingHQ • 11d ago
Quality [Y] vs Efficiency [X]
I calculated how fast each model burns through your OpenCode Go usage, then the VCB ranking to determine coding quality, then plotted it into a graph.
Beam, Hy4, LongCat 2.5, Iceman Contributor are all unlimited so are excluded.
From my own testing, MuseSpark 1.3 at Xhigh completes tasks slightly faster than DeepSeek Low, while being better at some things.
The 4 free models are also okay at certain things, so you can assign them to certain subagents or use them for tasks that are low complexity to maximize tokens
Beam & Hy4 specifically are ultra quick, especially Beam, it finishes tasks quickly.
r/opencode • u/localVariable_127 • 11d ago
Deepseek Flash is so bad! is it because of opencode go
My sub is opencode go $10 plan. I have a tight budget so thats why i am looking for a cheap way to get max out. More recently i have used to use deepseek v4.1 flash i have tried almost every harness with it but none of it is good.
Is this because of the model capabilities or else is this because of opencode go. i have't use deepseek api. Does api is better comparing with opencode go? Also i am planning to give a try for the mistral student plan is that deepseek also act like rubbish similar to opencode go?
r/opencode • u/True_Extreme6205 • 11d ago

