Skip to content

Savings review fixes that missed 0.7.0 (0.7.1) - #37

Merged
cris005 merged 9 commits into
mainfrom
fix/savings-review-fixes
Nov 2, 2026
Merged

cris005 merged 9 commits into
mainfrom
fix/savings-review-fixes

Conversation

@cris005

@cris005 cris005 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

This PR bumps the version to 0.7.1, so merging it into main triggers the release.

These six review-fix commits were made on the local savings stack branches but never pushed, so they missed the 0.7.0 release (#29–#34). They are cherry-picked onto main here with -x, and all six applied without conflicts.

Fixes

  • Catalog reloads (PriceBook): a failed catalog reload is no longer cached per model, so a later lookup retries. Reloads are spaced at least CATALOG_RETRY_MS (60s) after a failure.
  • models.dev (ModelsDevPrices): a body with no priced models is rejected as a failed fetch, not cached for a day. Providers with no priced models are dropped from the pruned body. DATE_SUFFIX and LATEST_SUFFIX move to constants/savings.ts.
  • Ledger reads (LedgerStore): a storage read error is no longer cached as empty totals. Changes made while the record is unreadable are held back and applied after the next successful read, so a stored ledger is never overwritten blind.
  • Prefix estimate (KeepaliveEngine): on wires that report no 1h/5m split, the first primary context stands in for the prefix. Only hybrid turns count a 1h write as the prefix. Title and generate calls no longer end a stretch or overtake a pending return; only primary and compaction turns do.
  • Tests: a server round trip for the stale-implicit fix, the negative net-saved sidebar row, and properties for price tiers and models.dev pruning.
  • Docs: README and UPGRADE wording now says pings shows a cost only when every ping was priced. The cache.write note now says it covers 5m and 30m writes, while 1h and 12h writes are priced from input. Added a CONTRIBUTING note on regenerating all three images.

Also in this PR

  • README: a table of contents after the intro, with the ### sections nested under their parents.
  • Tests: the alias ping capture and the split-cache turn, ping and return steps move into shared helpers, which clears SonarCloud's duplication gate (6.7% → 0.0%).

Checks

  • bun run build, fmt:check, lint and typecheck are clean.
  • bun test: 1139 pass (up from 1122 on main).
  • bun scripts/capture-sidebar.ts --all regenerates byte-identical images. The changed "Savings turned off" sample renders the same, as it should.
  • GitNexus detect_changes rates this high risk: 41 symbols in 15 flows, all in the savings and keepalive area.

… the settled state

(cherry picked from commit 608139d4b17579852a0382f0fe936214f9f390f0)
…odies

A failed per-model catalog reload is no longer cached forever: it is
retried after CATALOG_RETRY_MS. A models.dev body with no priced models
is treated as a failed fetch, so it no longer replaces a good cache.
Also: suffix regexes move to constants/, property tests for the catalog
and models.dev parsers, a wider fetch-json timeout window, .ts imports.

(cherry picked from commit db299a8b07044da8b48004452267b90d3efabb1e)
(cherry picked from commit a745a77ef8231b042a91fe920b1659e44802bd47)
…es start on session turns only

(cherry picked from commit 8b452382beb351136f629b260b88dc928561fdea)
(cherry picked from commit 15929d3d6a251757f451977ed572e3d27eb3f615)
(cherry picked from commit 0de02cf5eef72bc47a491ed8f0b0ffb7da8a73c4)
SonarCloud flagged 6.7% duplication on new code (limit 3%): the aged
alias test copied the ping mock from the alias test above it, and the
split-cache tests repeated the same turn, hit ping and return.
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@cris005
cris005 merged commit daf7998 into main Nov 2, 2026
3 checks passed
@cris005
cris005 deleted the fix/savings-review-fixes branch November 2, 2026 05:46
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