by LaurensBER · 4mo ago · 0 comments
# Prompt Cache Misses
> It globs your filesystem and re-reads AGENTS.md (injected in turn-0 system prompt) on every SSE turn. If you put a quick note in AGENTS.md to be read in the next session, you immediately force a full re-evaluation.
> Personal favourite: it puts the current date in the turn-0 system prompt and re-evaluates every SSE turn. If you’re using OpenCode at midnight you get a full prompt cache miss.
Okay, I can live with those.
# Compaction
> Want to sit for 10 minutes while the LLM server prefills the entire session with a new prompt prefixed to it, just to turn it into 5 bullet points that go at the top of a new session? Me neither. I get what they are going for, but I’ve not seen it work well. Neither compaction nor pruning is implemented well, and they interact poorly.
Is this an OpenCode specific issue? I've seen the same with Codex and Claude
# System Prompts
> The default system prompt is opinionated (fine) but it has shit opinions (not fine). It took me a while to figure out why my agent kept saying “Use ABSOLUTELY NO COMMENTS” when dispatching subagents.
Okay, so change it? Any LLM is opinionated, this system prompt enforces consistency across different models which seems reasonable.
Just wanted to add a few things:
- We actually don't do tool-call pruning any more. But compaction is a necessary evil for the time being. There's only so much context window, and if you wish to keep working on the same task for a long time, the model needs to summarize its current progress so it can continue without hitting its token ceiling.
- With V2 (in beta atm), we have a new system for handling changing system instructions (AGENTS.md files, available skills, etc.) that avoids cache misses at all costs, while still giving the robot the newest information. I recorded a little video about it here:
I updated one of my opencode containers today and had to downgrade it back because:
1. Worktree/workspace support is gone altogether. No way for agent to work in parallel on different things safely except prompting it directly to create a worktree.
2. Seeing multiple sessions properly now requires opening tabs for those?
3. In general, switching between several projects/sessions/whatever stopped working, and command palette is hotkey-only.
Issues about the new design just sit in an endless unsolved pile on GitHub which seems hopeless. And an agressive stale bot is not helping with that.
I came to OpenCode because it seemed hackable and simple, and at this point it seems like a "move fast break a lot" project that you got to live with.
(rant over, sorry if this is addressed to the wrong person, just needed to vent a bit)
Workspace support is being worked on, it was half-implemented before, so we are taking a proper pass at it now.
For switching between sessions, can you tell me about your workflow from before? Because a tab can hold a session from any project. Are you saying that opening up a tab is too heavy of an action?
GitHub issues though has been a problem from us, we deal with a ton of noise/spam.
I'm working at the same time with 3-4 different projects and multiple tasks inside the same project.
Earlier with the sidebar I could easily go back to review previous chats, as I'm often working on multiple separate but somewhat connected tasks inside the same branch. Having just a tab for context is both visually limiting (personal preference probably).
The worktree support could use a configuration for setup, running and teardown (look at Jean for that - works pretty well) as a way to have more complex setup. In my case with Rails + Vue apps, each worktree would then have separate db, rails+vite ports, etc so that I can visually check multiple completed tasks in isolation.
in 1.17 I get basically a three-level hierarchy: project -> workspace -> session
I could say I rarely use more than one session per workspace (not including subagents), but switching between projects as totally separate contexts works good.
Tabs on the other hand are less organized, I can see them being fine for sessions in one project (although sidebar is more ergonomical on both desktop and mobile)
Keep in mind that this is coming from someone who has a live browser tab counter website: https://tabs.evtn.me/
I liked Opencode a lot previously but there's no doubt it's not well-written software. Pi has fully replaced it for me and there are quite a few newer options that learned from Opencode and exercise more minimalism where it matters
It hardly matters that it's vibe coded and ugly if it works well... and it does (for me).
Saving a few CPU cycles and reducing RAM utilization on my local system isn't going to meaningfully improve anything in and of itself; the wall time is all bounded by the model or by the code it's invoking (i.e. compiling or running the test suite).
All of the major search engines have understood that as a stand-in for "Go the programming language" for many years.
I generally view the kind of code in projects like OpenCode to be the same as binary machine code, and the harness that works on it is the compiler. The source code is the prompts (I guess), except we live in a weird state now we use the existing machine code + more prompts to make even more machine code.
It's written in Rust. It seems to perform well. It also seems (from my poking around in it) on the whole well and deliberately written. It doesn't consume memory like a mf'er like Claude Code. It doesn't sit and chew background CPU like I've seen opencode.
I suspect it will accumulate more specific-to-OpenAI-isms over time though.
Those are labeled as "annoying things"
Read also the "alarming things"
There is another section titled "Alarming Things", with a subsection titled "It’s Fucking Full of RCEs". (Those are RCEs other than those which simply derive from the issues pointed out in previous subsections).
So that's why OpenCode likes to randomly remove my comments.
I have the following in my instructions, but I often need to remind agents of it because they follow the shitty system prompt instructions:
"ALWAYS include MANY inline code comments describing what blocks of code are supposed to be doing. Inline comments serve as inline specification, a parity check between the code and the specification, and are a means to _communicate_ with all future programmers, including yourself. Write Once, Read Many. The code needs to talk to whomever is looking at it in natural language."
https://github.com/anomalyco/opencode/releases?page=21#relea...
Personally, I run pi-agent in a custom sandbox based on bwrap, with an internet proxy. This mostly limits the blast radius to one source tree and one git checkout. And I don't give it push/pull permission. Local models are fun in a "closely supervised but slightly clueless minion" sort of way.
yes it's bad if the permission system is broken, but serious users have not trusted this stuff for a while, find the built-in permissions layer burdensome, and are already using a safety layer somewhere else
It'd be better if they had absolutely no permission enforcement and delegated it entirely to another program, as you say.
> It globs your filesystem and re-reads AGENTS.md (injected in turn-0 system prompt) on every SSE turn. If you put a quick note in AGENTS.md to be read in the next session, you immediately force a full re-evaluation.
> Personal favourite: it puts the current date in the turn-0 system prompt and re-evaluates every SSE turn. If you’re using OpenCode at midnight you get a full prompt cache miss.
I used opencode with deepseek v4 via openrouter during the weekend. Openrouter claims a cache hit rate of about 95%. Maybe it can be improved, but it doesn't seem broken.
I agree that it is bloated, and uses a lot of memory and cpu. But I don't remember seeing any bug during its usage, or at least not big enough to notice
I think that is reasonable and intuitive.
That was the first complaint I came across in the article and it made me question the level of indignation of the whole thing.
The post is pretty explicit about it happening on every SSE turn, but I realise if I write something that is (to put it mildly) a rant, then I shouldn't expect people to read it charitably.
I also wouldn't mind being prompted before invalidating so I can decide whether to keep my cache, like most editors will prompt you if a file is edited externally.
Comments can always be stripped reliably later.
> If you don’t know what OpenCode is, imagine a boot stamping on a human face forever. The boot is made of TypeScript and the face is everything we have learned about security and systems software since the invention of the electronic computer in the 1940s.
Regardless if that's a good or bad take, I'd like titles on HN to reflect what the author wanted to say and not editorialized to what HN readers think the article should be saying.
Sad but not surprised to hear about all these other issues. I like opencode, it does plenty right but plenty wrong.
> Okay, so change it? Any LLM is opinionated, this system prompt enforces consistency across different models which seems reasonable.
OpenCode embeds scatters bad coding policy all over all of its inbuilt prompts, including tool instructions. The only way I've found to fix them is to edit the source code. And, yes, they're also huge and repetitive.
A framework's native prompts should include only information about how to interact with the framework itself.
https://artificialanalysis.ai/agents/coding-agents?coding-ag...
It's honestly embarrassing to call this open source.
Pi on the other hand, whilst they have their own unique issues with PRs, if you came to them with a genuine problem, or fix, they seem to accept it.
Now I point back to those issues you pointed out, all have PRs... Unmerged. Same with the infinite depth subagent calling.
OpenCode has an MIT license, which allows you to copy/fork the code and modify it how you see fit.
Please review the open source initiative's definition of open source: https://opensource.org/osd
Like many popular Ai projects, they get 1000s of slop PRs. They are also working on a v2, so fixes to old code are much less likely to land now.