anomalyco / anomalyco/opencode

Gemini and Vertex prompt cache drops out due to 4m warming interval and missing cachedContent

Open
#43,628 2 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Aug 20, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Gemini and Google Cloud Vertex AI prompt caches experience 100% cache misses during multi-turn sessions when paused for ~3.5 minutes due to the provider's ephemeral in-memory cache TTL and lack of explicit cachedContent lowering in the Gemini protocol.
The default session warming interval was set to 4 minutes, which fires after Google's ~3 to 5 minute ephemeral cache window has already evicted the prefix.

Plugins

None

OpenCode version

v2 (0.0.0-dev)

Steps to reproduce
  1. Run a multi-turn session with google-vertex/gemini-3.7-flash or google/gemini-2.5-flash where context exceeds 32k tokens.
  2. Pause for ~3.5 minutes between turns.
  3. Observe that the subsequent turn suffers a 100% prompt cache miss because the default 4-minute warming timer had not yet fired.
Screenshot and/or share link

No response

Operating System

Linux / macOS

Terminal

Alacritty / Ghostty

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.