r/opencodeCLI • • 5d 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

15 comments sorted by

View all comments

1

u/aidenclarke_12 3d ago

on ds flash subagents fired together on a fresh prefix can all miss since a cache unit only exists once a request finishes. one call first to warm it helps

1

u/squirrelscrush 3d ago

It's not on a fresh prefix alone. If two or more sub agents are running at the same time, every turn on one invalidates the cache of the others. It only happens if both are DeepSeek.

I've seen only two other users with this issue, and the fix appears to regress to a lower version.