feat: session cache footer in Pi's status bar - #2
Open
Saolence wants to merge 2 commits into
Open
Conversation
Saolence
force-pushed
the
feat/cache-footer
branch
from
August 3, 2026 13:37
6102e07 to
a309ddf
Compare
- Status key changed to `!reasonix` so Pi's alphabetical extension-status sort places the banner leftmost (pi-lens uses `pi-lens-lsp`, which otherwise sorts before `reasonix`) - Footer now appends non-zero `w<X>` (cache writes) and 🔧/🌀/⚙ (repaired / storms / compacted) counters; a quiet session stays short
Saolence
force-pushed
the
feat/cache-footer
branch
from
August 3, 2026 13:43
a309ddf to
3990a4d
Compare
…ted to the first file
Saolence
force-pushed
the
feat/cache-footer
branch
from
August 4, 2026 00:29
57238bd to
f999d31
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a cache-stats footer in Pi's status bar: a one-line summary of the current session's cache usage, rendered via
setStatus— the same surface pi-cache-optimizer uses.Why
Reasonix already collects the exact usage numbers (
cacheRead/cacheWrite/input frommessage_end) and exposes them in/reasonix-status, but only on demand. The footer makes the cache hit rate continuously visible so you can tell at a glance whether the prefix-stabilization pillar is doing its job.What changed
totalRequests/hitRequestsonReasonixStats, incremented frommessage_endusage (and the header fallback atturn_end). Counters reset on/reloador Pi restart — no on-disk persistence, mirroring pi-cache-optimizer's session footer mode.src/footer.ts: pure rendering —formatTokenCount/formatCacheFooterproducing⚡️ 560/572 · 86.80M/90.01M (96%).extensions/index.ts: render the footer through the handler context'sctx.ui.setStatusatmessage_end/turn_end, with an idempotent render guard.REASONIX_FOOTER=0disables the footer (default on — it only renders read-mostly stats, unlike the opt-inREASONIX_SCAVENGE).!reasonixso Pi's alphabetical status sort keeps the banner leftmost (pi-lens'spi-lens-lspwould otherwise sort first).w<X>(cache writes) and 🔧/🌀/⚙ (repaired / storms / compacted) counters append only when present, keeping a quiet session short.PrefixGuard.lastChangeReasonattributes head changes tosystem/tools(/reasonix-status→Cache head:)./reasonix-statusshows the same footer text.test/footer.test.mjs: 3 unit tests for token formatting and footer rendering.