Repository navigation
Conversation
…s a TTL requestSent committed a snapshot that still carried the previous turn's implicit skip reason, so the server dropped the primary messages it had just stored and the first ping after a learned alias went out unaligned.
The hero sample now carries a priced ledger, so sidebar.svg shows the `($0.05)` suffix and the `saved` and `return` rows. sidebar-states.svg gains four captioned states: savings in dollars, without a model price, nothing saved yet, and savings turned off. The older states keep no savings readout so each still shows only what it is about. docs/images/picker.png, a manual screenshot, is replaced by picker.svg, drawn by a capture-only lookalike of OpenCode's dialog.select (scripts/capture/picker-dialog.tsx). Its rows come from the real settingsOptions() with built-in defaults and no session override. Every dimension and colour is taken from OpenCode v2.2.1 (tag v2.2.1, commit 3ebcf9a), legacy layout with the "new-designs" experiment off: ui/dialog.tsx and ui/dialog-select.tsx for the 60-column width and insets, and theme/assets/v2/opencode.json resolved for the dialog surface for the colours. freeze drops SGR bold, so the script now restores every bold run it finds in the screen's ANSI rows (restoreBold), not just the sidebar's section header. Compared with the old screenshot: same rows, order, highlighted first Session row and bold section headers, plus the new Savings rows. The colours differ because the screenshot used another theme: the image uses OpenCode's default dark theme (dialog #141414, selected row #fab283 with #0a0a0a bold text, section headers #9d7cd8, muted text #808080). The cursor is drawn as a #fab283 block over the first placeholder letter (the real one is the terminal's). The dialog sits on freeze's #0a0a0a padding rather than the dimmed session behind it.
|
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.




Adds a per-session savings ledger to the sidebar. It shows what keepalive pings cost and what they saved, so you can see the plugin paying for itself. Version 0.7.0.
What counts as a save
An idle stretch counts as one avoided cache rewrite when all three hold:
Every ambiguous case counts less:
hybrid: only the short-lived part counts. The prefix is the largest 1h write on Claude, or the first primary context on GPT-5.6+. If the prefix size is unknown, no save is counted.Prices
ctx.model.list(), which includes acostyou declare inopencode.jsonc. The size-based tiers are honoured.modelsDevPricesoption, default off. The plugin makes no network calls of its own while it's off. With it on, prices are fetched once a day, cached in plugin storage, pruned to prices only, and fetched with a timeout.Changes
CacheUsage.outputTokensis parsed on all three wires.savingssetting (default on): in the picker (Session and Global), as/cache-manager savings on|off, and as a plugin option. Off hides the rows; the ledger keeps counting.services/savings-math.ts,model-prices.ts,models-dev.ts,ledger-store.ts,savings-ledger.tsandfetch-json.ts, plusmodels/savings.tsandconstants/savings.ts.showSavingsandsavings.implicitskip reason made the first ping after a learned alias go out unaligned. Wiring the ledger exposed it.ledger/<sessionID>. A single startup pass sweeps bothsession/andledger/keys of deleted sessions.saved/returnrows and the($…)stretch cost.picker.png(a screenshot) is replaced by a generatedpicker.svg. It's built from the realsettingsOptions(), with dimensions and colours taken from OpenCode v2.2.1's dialog-select and theme source.costexample inopencode.openai-compatible.jsonc.prompt_cache_breakpointdrop is fixed upstream (OmniRoute #18254 / PR #18255, merged 2026-10-27) but not in a release yet.Before release
docs/images/picker.svgwith a real screenshot of the picker (dimensions, colours).costdeclared on a custom provider's model inopencode.jsonccomes back fromctx.model.list().mainto 0.7.0, which the release workflow tags and publishes.Testing
bun run fmt:check,bun run lint,bun run typecheckandbun testall pass: 1122 tests, 0 failures.