hi @Artemonim Thanks for the post! I checked this run, and it seems like caching was working fine … The important distinction is that these panels measure different things, so the numbers are not expected to match.
207.9K Context Usage is one snapshot. It shows how much context was in the model’s working prompt near the end of the run.
855.1K Input Tokens is a cumulative total across all 123 model calls the Agent made during the run. It is not the size of any single prompt.
Each Agent step makes another model call using much of the growing conversation again. Across all 123 calls, the model processed 18.02M prompt tokens:
17.16M were repeated context served from Gemini’s cache.
855K were input tokens not served from cache, including newly added context and occasional cache misses.
So the 207.9K context did not “turn into” 855K input. The 207.9K is the approximate size of one late-stage prompt, while 855K is the sum of the uncached portions from 123 prompts. About 95.3% of the prompt tokens were served from cache. The displayed $2.13 matches that: without caching, the same cumulative prompt volume would have been approximately $13.72 at the published rates.
However, if there were no long pauses or the beginning of the prompt was not rewrited, then the input (or cache write) should match the final size of the session window (if no context summarization occurred).