logoalt Hacker News

LaurensBERyesterday at 1:27 PM15 repliesview on HN

I feel that a better title for this article would be: "Some minor annoyances that, when fixed, would improve OpenCode"

# 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.


Replies

nylonstrungyesterday at 2:15 PM

The bigger point is that the codebase is hopelessly bloated by vibe coded features at this point, mirroring the same problems with Claude Code. And stability, performance, memory use have all gotten terrible.

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

show 4 replies
k-langtonyesterday at 2:57 PM

Hey! I work on OpenCode, so thank you for this measured reply ;)

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:

https://x.com/kitlangton/status/2075749116760457346/video/1

show 3 replies
nextaccounticyesterday at 1:32 PM

> I feel that a better title for this article would be: "Some minor annoyances that, when fixed, would improve OpenCode"

Those are labeled as "annoying things"

Read also the "alarming things"

lynndotpyyesterday at 1:46 PM

This article has several sections and you are commenting on things under the section titled "Annoying 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).

show 1 reply
cpburns2009yesterday at 1:35 PM

>> > 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.

So that's why OpenCode likes to randomly remove my comments.

disiplusyesterday at 2:09 PM

Cache Misses are pretty bad, i have a locally running deepseek v4 flash, i have tuned it now to have 1100-1300 prefill. Its not great but properly useable. Imagine having a session with already 100k and half of it has to be prefilled it would be waiting minutes with worse numbers. And if you are paying by the token, for hosted models, you are wasting money.

mrigheleyesterday at 3:03 PM

# 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.

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

show 1 reply
brianjkingyesterday at 1:46 PM

Definitely agree on the title. Also could have worked as 'Some minor annoyances that, when fixed, would improve OpenCode. Also, I don't like AI"

show 1 reply
cevnyesterday at 1:45 PM

I actually share that opinion of no comment from LLMs. I just dont want to read them. So as usual, an opinion is… an opinion.

show 1 reply
tomCombyesterday at 3:52 PM

IMO, if you "put a quick note in AGENTS.md" then you should expect a cache miss.

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.

xg15yesterday at 2:22 PM

> I feel that a better title for this article would be: "Some minor annoyances that, when fixed, would improve OpenCode"

> 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.

versteegenyesterday at 2:19 PM

I always run opencode with envvar `OPENCODE_DISABLE_AUTOCOMPACT=1` because I discover a new horrible bug in its autocompact every time I don't... including the config .json option to turn off autocompact not working.

Sad but not surprised to hear about all these other issues. I like opencode, it does plenty right but plenty wrong.

whythismattersyesterday at 3:14 PM

When I looked into opencode a few months ago I was struck by the default system prompt which came across as messy and random, iirc it also contained a typo or two. It made me look elsewhere and I didn't look back.

Hizonneryesterday at 2:06 PM

> > 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.

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.

intothemildyesterday at 2:39 PM

That's the thing. You can't change it. They do not accept PRs from what I've seen. Whilst it's open source it's only in name. There may be the odd PR accepted from outside the team. But very very rarely.

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.

show 1 reply