Skip to content

feat(panel): prompt-cache hit rate in /acp status - #213

Merged
ranxianglei merged 1 commit into
masterfrom
2026-08-24_panel-cache
Aug 23, 2026
Merged

feat(panel): prompt-cache hit rate in /acp status#213
ranxianglei merged 1 commit into
masterfrom
2026-08-24_panel-cache

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Model: Claude Sonnet 4.5

What

Show prompt-cache hit rate in the /acp status panel — real-time (last request) + session average.

Renders only when the provider reports cache usage, e.g.:

Prompt cache (provider-reported): 90.0% last · 93.0% session avg — 279k of 300k billed prompt tokens served from cache (2 req)
  • acp-kernel 0.0.43 → 0.0.44 (panel cacheUsages input — kernel PR feat(panel): prompt-cache hit-rate section (last + session avg) acp-kernel#157, released as v0.0.44 via release v0.0.44 acp-kernel#158)
  • Host side: cacheUsageSamples() collects per-assistant-message provider usage from session entries (runtime.stateFor() already returns them) and feeds buildStatusPanel
  • Only requests with cacheRead + cacheWrite > 0 count (providers without cache reporting never drag the average to a fake 0%); section is omitted entirely when no request qualifies

Tests

+2 end-to-end panel cases (rates rendered from mocked entries; section omitted without usage). Full suite: 411/411 pass, typecheck clean.

- commands.ts: cacheUsageSamples() extracts per-request {input, cacheRead,
  cacheWrite} from assistant messages in stateFor() entries; passed as
  buildStatusPanel cacheUsages. Requests without provider cache reporting
  stay 0/0 (kernel cacheHitStats excludes them from the average).
- Requires acp-kernel 0.0.44 (panel cacheUsages field) — dep bump + lock
  regen in a follow-up commit once v0.0.44 is released.
- tests: end-to-end render (93.0% session / 90.0% last from mixed usage
  entries) + omission when entries carry no cache-reported usage
@github-actions

Copy link
Copy Markdown

📦 Built Extension Artifact

Branch: 2026-08-24_panel-cache (2b4ef93)

Option A — Install from npm PR tag (recommended)

pi install npm:billion-context-pi@pr-213

Each push to this PR publishes a new version under the pr-213 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pi-pr213.tgz
pi install ./package

This comment is automatically updated on each push.

@ranxianglei
ranxianglei merged commit 1c87eb5 into master Aug 23, 2026
9 checks passed
@ranxianglei ranxianglei mentioned this pull request Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant