Repository navigation
Record prompt-cache lifetime and compaction point for Codex and Antigravity #40936
LoveJazzTZ
started this conversation in
Ideas
Replies: 1 comment
|
Hey this metadata would also directly unlock another use case I just proposed in #44039: auto-compacting large threads right before hitting 100% quota while caches are still warm to avoid a ~150K to >1M token cold replay hit after reset. I'm curious what you think if you're interested and take a look. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Agents that run many T3 chats need to know whether an existing chat's prompt cache is still warm, and how close it is to compaction, before they send to it. T3 already records both for Claude: each provider turn's
tokenUsagehaspromptCacheTtlMs,promptCacheExpiresAtandautoCompactThreshold(ClaudeAdapterV2.ts). Codex and Antigravity (Gemini) do not.Requests
tokenUsage(codexProviderTurnTokenUsage) has no cache lifetime and no compaction point.promptCacheTtlMsandpromptCacheExpiresAt(from theprompt_cache_optionsttl the app-server sends, or the model's documented default).autoCompactThreshold(the effectivemodel_auto_compact_token_limit, or the model's default).turnTokenUsagebut not the turn'stokenUsage(turn record), so Antigravity turns have no time, context size, compaction point or cache lifetime. The thread'scontextUsagehas no time either.tokenUsagefor Antigravity turns from the turn's lastusage_update(usedTokens,maxTokens,updatedAt).autoCompactThreshold, the effective compaction point (related: feat(antigravity): configure the auto-compaction window #34028).promptCacheTtlMsandpromptCacheExpiresAtonly if Gemini or agy states a cache lifetime; otherwise leave them unset rather than guess.turnTokenUsage.usageStatus: "unavailable". A short reason there (for exampleusage limit) would tell agents this apart from a missing record.Why it matters
A message to a chat whose cache has expired, or that is near compaction, costs about as much as a fresh chat. Without these fields, agents have to guess, or treat every such chat as cold.
Related
All reactions