Skip to content

feat(web): count down the prompt cache in the context meter - #3

Open
n0ah37 wants to merge 1 commit into
feat/context-meter-session-costfrom
feat/context-meter-cache-timer
Open

n0ah37 wants to merge 1 commit into
feat/context-meter-session-costfrom
feat/context-meter-cache-timer

Conversation

@n0ah37

@n0ah37 n0ah37 commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Users can't see how long a Claude thread's prompt cache has left, so they can't tell whether returning to a large thread will re-read it cheaply or rewrite it at full price. Requested in Ideas discussion pingdotgg#7590. Stacked on #2 (session cost).

Change

  • Countdown. The context meter's popover gets a Cache row: 42:07 left, or Expired. The expiry is the last usage report's time plus the cache lifetime Claude reported. It ticks once a second only while the popover is open, so a closed meter does no work.
  • Lifetime carried forward (Claude adapter). Claude reports the cache lifetime only on responses that wrote to the cache. A response that only read it refreshed the same entry, so the adapter keeps the last lifetime its process wrote; without this the row would flicker away between turns.
  • Providers that report no cache lifetime show no row.

Verification

  • vp test run apps/web/src/lib/contextWindow.test.ts apps/web/src/components/chat/ContextWindowMeter.logic.test.ts apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts: passed, including new cases for the expiry time, the countdown format, and the carried-forward lifetime.
  • Claude and orchestrator replay fixtures: passed. Typecheck passes for server and web.

Built with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

@n0ah37
n0ah37 force-pushed the feat/context-meter-cache-timer branch from 319f667 to 328508e Compare October 11, 2026 12:19
@n0ah37
n0ah37 force-pushed the feat/context-meter-session-cost branch from c354413 to 27a9fe0 Compare October 11, 2026 12:19
@n0ah37
n0ah37 force-pushed the feat/context-meter-cache-timer branch from 328508e to 6eb4b3c Compare October 11, 2026 15:42
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Oct 11, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 6eb4b3c.

This comment will update automatically after the next completed run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant