Repository navigation
fix(usage): repeat usage scans no longer decode unchanged Antigravity databases - #17139
Conversation
Every usage summary decoded every Antigravity conversation database again, blocking the server long enough for clients to drop the connection. Memoise each database's parsed candidates by the (size, mtime) of the file and its WAL sidecar, and keep merging aliases before the date filter.
A rewrite that restores size and mtime still moves ctime, so the cache no longer serves stale candidates in that case. The reuse test now proves a cache hit with an exclusive lock instead of a forged rewrite, and the forged rewrite gets its own test that expects a fresh read.
On kernels with coarse timestamps a write in the same tick as the cached read keeps the same ctime, so the test repeats the rewrite until ctime moves, as any real rewrite does.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused usage-performance fix that reuses parsed Antigravity data only when the database and WAL are unchanged, while preserving alias merging and date filtering. Targeted tests cover cache reuse, WAL updates, and rewritten databases, with no product-default or static-analysis changes. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughAntigravity usage scans can reuse parsed candidates when the database and WAL fingerprints are unchanged. UsageService now retains and passes the cache across scans. Tests cover cache reuse, database rewrites, and WAL-only updates. ChangesAntigravity usage cache
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue remains from this review. The change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides detailed problem, change, limitations, and verification information. However, it does not use the required section headings, and the Scope and approval information does not include explicit maintainer approval or explain why the fix qualifies for an exemption. Resolution Organize the description under the required Problem, Change, Scope and approval, and Verification headings. Add a link to the triaged issue or maintainer approval comment, or explain why this focused fix qualifies for the obvious-bug exemption.
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…only what is still updating Imported from #16376 (5 commits squashed onto current main): - perf(usage): the usage page loads in a fraction of a second and dims only what is still updating - refactor(usage): simpler loading states and Cursor cache - fix(usage): cache writes finish before the usage service shuts down - fix(usage): address review findings - fix(web): a window that fails everywhere keeps the last usage on screen Conflicts with main resolved: Antigravity scan cache (#17139) and the Usage provider filter (#16970). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
## What's Changed * feat(providers): run Muse Code as a native provider by @t3dotgg in pingdotgg/t3code#17082 * feat(web): compact-before-send is a chip that shows the token count by @t3dotgg in pingdotgg/t3code#17127 * fix(clients): copy button is back in its old spot, before fork by @t3dotgg in pingdotgg/t3code#17137 * fix(usage): repeat usage scans no longer decode unchanged Antigravity databases by @t3dotgg in pingdotgg/t3code#17139 * fix(server): shell snapshots no longer block other database reads while decoding by @t3dotgg in pingdotgg/t3code#17141 * perf(server): ACP tool updates no longer persist a snapshot per streamed chunk by @darjss in pingdotgg/t3code#16682 * feat(web): filter the Usage page to just the providers you want by @t3dotgg in pingdotgg/t3code#16970 * fix(usage): Cursor account history loads about 4x faster by @t3dotgg in pingdotgg/t3code#17140 * fix(server): threads settle as soon as branch status sees their PR merge by @t3dotgg in pingdotgg/t3code#17148 * perf(usage): the Usage page shows numbers in under a second and dims only what is still loading by @t3dotgg in pingdotgg/t3code#17147 * fix(server): an agent can settle its own thread when its turn ends by @t3dotgg in pingdotgg/t3code#17145 * feat(web): Add provider button sits with the provider list by @t3dotgg in pingdotgg/t3code#17152 ## New Contributors * @darjss made their first contribution in pingdotgg/t3code#16682 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2813...v0.0.46-nightly.20261008.2819 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2819
## What's Changed * feat(providers): run Muse Code as a native provider by @t3dotgg in pingdotgg/t3code#17082 * feat(web): compact-before-send is a chip that shows the token count by @t3dotgg in pingdotgg/t3code#17127 * fix(clients): copy button is back in its old spot, before fork by @t3dotgg in pingdotgg/t3code#17137 * fix(usage): repeat usage scans no longer decode unchanged Antigravity databases by @t3dotgg in pingdotgg/t3code#17139 * fix(server): shell snapshots no longer block other database reads while decoding by @t3dotgg in pingdotgg/t3code#17141 * perf(server): ACP tool updates no longer persist a snapshot per streamed chunk by @darjss in pingdotgg/t3code#16682 * feat(web): filter the Usage page to just the providers you want by @t3dotgg in pingdotgg/t3code#16970 * fix(usage): Cursor account history loads about 4x faster by @t3dotgg in pingdotgg/t3code#17140 * fix(server): threads settle as soon as branch status sees their PR merge by @t3dotgg in pingdotgg/t3code#17148 * perf(usage): the Usage page shows numbers in under a second and dims only what is still loading by @t3dotgg in pingdotgg/t3code#17147 * fix(server): an agent can settle its own thread when its turn ends by @t3dotgg in pingdotgg/t3code#17145 * feat(web): Add provider button sits with the provider list by @t3dotgg in pingdotgg/t3code#17152 ## New Contributors * @darjss made their first contribution in pingdotgg/t3code#16682 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2813...v0.0.46-nightly.20261008.2819 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2819
Brings in Theo's Usage work: progressive loading with a Cursor cache and the awaitRefresh follow-up (pingdotgg#17147), the provider filter (pingdotgg#16970), faster Cursor paging (pingdotgg#17140) and the Antigravity scan cache (pingdotgg#17139). Resolution: - Contract keeps both groupByThread and awaitRefresh. - Server: upstream's parallel source scans; transcript scans still carry the account, each session's folder and sub-agent labels; attribution runs alongside the scans. - Web: statuses carry upstream's isConnected next to the offline fields; the provider filter applies before saved usage is trimmed; the page keeps the previous period on screen while a new one loads, and the explorer mutes its totals, chart, by-type section and list while figures are still coming in, and each provider row while that provider refreshes. Also fixes a Macroscope finding: a resumed Claude scan no longer replaces a session's original folder with one from later records, which could move it to another project.
The Usage page made the desktop app show "reconnecting" for users with a large Antigravity history (#13852). Every
getUsageSummarydecoded every Antigravity.dbon the server thread, even files that had not changed, so the event loop stalled for seconds on each request.Now each database is decoded once and reused on later scans while the database and its
-walsidecar keep the same size, mtime, and ctime. The WAL is in the key because new rows land there before the main file changes. ctime is in the key because it moves on any write, even one that restores size and mtime. Aliases still merge across every database before the date window applies.This does not fix the first scan after a server restart. The cache is in memory only, and the read still runs on the main thread. Those are follow-ups on the issue.
Takeover of #13902 by @derektrimm, rebased onto current main with no code changes. The original commits keep Derek's authorship.
Proof:
vp test run src/usage/(145 passed) and the server typecheck. I disabled the cache, then the WAL part of the key, then the ctime part, and each time exactly one new test failed. On 30 Antigravity databases copied from a real machine, a repeat scan went from 27 ms to 3 ms with the same 618 records.🤖 Generated with Claude Code (Claude Opus 5.5)