Repository navigation
Know whether the next prompt will reuse a warm provider cache #4623
Replies: 1 comment 1 reply
|
Another concrete use case for preserving cache samples: I maintain TokenLedger, a community plugin that records per-turn tokens and estimates cost from a configurable price table. Cache creation can have a different rate from ordinary input, so losing that count prevents the plugin from explaining a reported total or estimating the missing component. The plugin already provides the ledger and UI using public Paseo APIs. The missing extension point is the usage data. I would like to keep provider transcript parsing out of the plugin. Current API boundaryVerified on Paseo 0.8.0 on Windows, with the source locations below rechecked on
For example, this synthetic Claude-shaped usage illustrates the loss: {"input_tokens":10,"cache_read_input_tokens":60,"cache_creation_input_tokens":30,"output_tokens":5}The current mapping preserves 10 input, 60 read, and 5 output tokens; the 30 creation tokens have no field in the public result. This is separate from the context-meter candidate selection and Smallest useful capabilityAn optional cache-creation count carried consistently through the provider adapter, wire schema, snapshots/terminal usage, and public SDK would let plugins handle the pricing and presentation. Please preserve missing versus zero and document whether input includes cache reads or writes. If a provider reports separately billed cache lifetimes, preserving their breakdown would avoid assuming one universal write multiplier. A useful acceptance case is inclusive input=100, reads=60, writes=30: ordinary input is 10. For exclusive input=10 with the same cache counts, it remains 10. A reported total that already includes writes must not have estimated write charges added again. This data extension could ship independently of cache warmth/TTL UI and of the child attribution discussed in #4660. Would preserving these optional counts in the existing usage contract be an acceptable first step? |
Uh oh!
There was an error while loading. Please reload this page.
What I am trying to do
Before sending another expensive prompt, I want to know whether the current agent's provider cache is likely still warm and how much of the previous request was served from cache.
This affects whether I continue now, wait, switch agents, or deliberately re-warm a session before a longer task.
How I do it today
Paseo shows context and cumulative usage, but it does not preserve or render a request-level cache sample. I infer cache behavior from provider billing, raw transcript fields, or elapsed time. By the time I learn a cache was cold, I have already paid the latency and token cost.
Where Paseo gets in the way
Cumulative cached-input totals do not answer whether the last request hit or when a documented cache lifetime will expire. Providers also report cache accounting differently, so comparing raw values is error-prone. For providers that do not publish a TTL, any countdown would be a guess.
What a better workflow looks like
The current agent's context/usage detail would show:
A manual re-warm action could send a small visible message, but it should be optional and honest that no provider exposes a read-only cache probe. Paseo only learns cache state by making a request.
The same normalized figures would be useful from the CLI when inspecting an agent.
Scope, providers, and plugins
Claude and Codex are the initial useful TTL cases. OpenCode, Pi, OMP, and ACP providers may expose cache counts without a documented lifetime; they should show ratios/age without inventing expiry. Presentation should work on web, Electron, iOS, and Android.
Provider adapters need to emit normalized request or cumulative samples, so the base telemetry seam belongs in core. A plugin could provide an alternate visualization later, but it should not independently reinterpret every provider's accounting.
I found no matching Discussion. This is one user's optimization workflow, and shared demand is not demonstrated. PR #4305 is prior exploration only.
All reactions