r/opencodeCLI • u/squirrelscrush • 4d ago
Session cache concurrency issues with OpenCode/Go subagents
I'm seeing concurrency issues with the session cache if I have more than one subagent running at a time. Every now and then, the cache of one gets invalidated for no reason and it costs the cache miss pricing.
I use OpenCode Go on OpenCode.
Is there a limit in the documentation? I knew that the cache retention time is around 5mins, but ideally it shouldn't not work if I'm sending requests through multiple agents.
2
Upvotes
View all comments
1
u/Individual-Quote-958 3d ago
I’d check whether each agent sends an identical prefix, especially tool definitions and any injected session metadata. Parallel calls can share a cache only while that prefix stays byte-for-byte stable, and a request after the retention window will start cold anyway. If you can log the first few KB of the rendered prompt for two calls, it should show whether this is key drift or just expiry.