logoalt Hacker News

FeepingCreaturetoday at 8:21 AM1 replyview on HN

I don't think that is true. It would be extremely noticeable (zero caching) and I am not noticing it.


Replies

LoganDarktoday at 9:44 AM

The first messages in the transcript are a dynamically generated system prompt that are recalculated every request and not persisted. This is just how OpenCode works. If the inputs to the calculation do not change, then it won't invalidate the cache, but whenever the inputs do, it does invalidate the cache.

From the latest commit on the dev branch,

here is the code that generates the system messages from scratch: https://github.com/anomalyco/opencode/blob/03521003fafdc6d34...

and here is the code that dynamically re-generates the system messages on every completion: https://github.com/anomalyco/opencode/blob/03521003fafdc6d34...

Regardless of how many invalidations occur in practice, this is not okay. You cannot just regenerate the start of the transcript dynamically throughout a session from things that change as frequently as current working directory. That's the worst etiquette I've ever seen in a harness.

show 1 reply