Repository navigation
feat: support multi-root discovery for Antigravity 2.0 and IDE - #182
Conversation
|
Thanks for this — I hit the same thing on the CLI side ( One note on the mtime fallback: it's one value per store, so a conversation that ran across midnight files its earlier half on the later day. On this machine (10 new-format stores) that moved 11,523,909 tokens from 8/18 to 8/19, leaving 8/18 at zero. The date also shifts again each time the store is written. There may be a per-record time available in the same store. The blob still carries Joining on I put it on top of your branch in case it saves you time — diff. |
The store's mtime is one value for every record it holds, so a conversation that ran across midnight files its earlier spend under the day it was last written, and that date moves again every time the store grows. Measured on ten 2.0-format stores: 11,523,909 tokens belonging to 2026-08-18 were reported under 2026-08-19, and the day they belong to read zero. Antigravity 2.0 still names the execution each record belongs to (`execution_id`, field 4), and the `steps` table of the same store holds per-step `created_at`, `finished_at` and `execution_id`. Dating each record from its own execution lands within ~2 minutes of the writer's own value, measured against the stores that still carry `created_at`. The join is on `execution_id` rather than on the row index, which is its own dense sequence and drifts from `steps.idx` by up to 21 minutes inside one conversation. Step times are handed out in order within an execution so a long execution is followed as it runs. The store's mtime stays as the last resort for a record no step can date. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thank you so much for the thoughtful and detailed feedback, @2JIHAN! The cross-midnight token drift you identified is a critical edge case, and reconstructing the timeline via I have cherry-picked your commit directly onto this branch so your authorship is fully preserved, verified all 686 tests pass locally, and added a special mention in the PR description's Acknowledgements section. Really appreciate your collaboration and help in making Antigravity 2.0 support so complete! 🙌 🤖 Generated with Antigravity 2.0 (AGY 2.0) |
Update: Consolidated with #190Per @seo92js's suggestion in #190, we have consolidated the timestamp reconstruction logic to use direct 1:1
🤖 Generated with Antigravity 2.0 (AGY 2.0) |
|
Thanks for consolidating this and for the credit! Could you please update the Thank you! |
…xecution fallback Correlate generation metadata timestamps directly with step metadata by response_id (1:1), falling back to in-order execution step timings and store modification time. Co-authored-by: Seo JeongSeop <seo92js@gmail.com>
4068b50 to
cb164c1
Compare
|
Done! Updated the 🤖 Generated with Antigravity 2.0 (AGY 2.0) |
|
Thanks to the three of you — @justinjeong5 , @2JIHAN, and @seo92js. Thank you for your contribution! |
…n#177) resolvedRoots hardcoded the CLI path, which is defaultRoots[1] after chattymin#182, so a no-root scan dropped 2.0/Core and IDE stores. Codex custom roots had the same class of hole against archived_sessions (chattymin#181).
Brings in the representative-Pokémon pin (chattymin#158), Antigravity 2.0 multi-root discovery (chattymin#182), Codex rollout memory bounding (chattymin#184), and fixes for Codex usage after session archiving (chattymin#181), the Kiro rescan (chattymin#178), the AppLog willTerminate flush (chattymin#174), the update-loop PID wait (chattymin#175), the popover outside-click monitor (chattymin#168), and menu bar/popover sprite aspect ratio (chattymin#194). All 11 are scope- and identity-agnostic, so nothing is rejected. Conflict resolutions: - PokeTokenBarApp / FloatingPetPanel: the menu bar and pet now read the representative subject AND the animation-quality frame floor. The floor stays in the frame-cache identity key and in the observation set, so pinning a species and changing FPS both take effect immediately. - UpdateChecker: took upstream's PID-based exit wait and testable launcher signature, kept the fork's cask token and login-agent label via AppIdentity. The fork guard that asserted `pgrep -x <executable>` now asserts the PID wait, since upstream deliberately replaced that mechanism. - UsageStore: kept the fork's async notification-authorization request, which avoids the Swift 6 executor trap the closure form hits. - CLAUDE.md: kept the fork-maintenance row alongside upstream's expanded defect-log row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat: add per-provider additional scan folders (#177) Logs outside the built-in paths were a silent undercount for every provider except Claude. Store one list per provider so parsers never share folders, and only add custom roots — never evict a curated default. * fix: union custom scan roots onto every Antigravity default (#177) resolvedRoots hardcoded the CLI path, which is defaultRoots[1] after #182, so a no-root scan dropped 2.0/Core and IDE stores. Codex custom roots had the same class of hole against archived_sessions (#181).
…ymin#182) * feat(antigravity): support multi-root discovery for Antigravity 2.0 and IDE * docs: update doc comments to reflect multi-root Antigravity discovery * fix: prevent MainActor isolation crash on notification authorization request * fix: fallback to database mtime when Protobuf created_at is absent in Antigravity 2.0 * fix: robustly distinguish absent Protobuf timestamp from invalid sentinels * fix: date Antigravity 2.0 records from their own execution steps The store's mtime is one value for every record it holds, so a conversation that ran across midnight files its earlier spend under the day it was last written, and that date moves again every time the store grows. Measured on ten 2.0-format stores: 11,523,909 tokens belonging to 2026-08-18 were reported under 2026-08-19, and the day they belong to read zero. Antigravity 2.0 still names the execution each record belongs to (`execution_id`, field 4), and the `steps` table of the same store holds per-step `created_at`, `finished_at` and `execution_id`. Dating each record from its own execution lands within ~2 minutes of the writer's own value, measured against the stores that still carry `created_at`. The join is on `execution_id` rather than on the row index, which is its own dense sequence and drifts from `steps.idx` by up to 21 minutes inside one conversation. Step times are handed out in order within an execution so a long execution is followed as it runs. The store's mtime stays as the last resort for a record no step can date. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat: correlate Antigravity timestamps by response_id with in-order execution fallback Correlate generation metadata timestamps directly with step metadata by response_id (1:1), falling back to in-order execution step timings and store modification time. Co-authored-by: Seo JeongSeop <seo92js@gmail.com> --------- Co-authored-by: Jihan <2jihan000@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Seo JeongSeop <seo92js@gmail.com>
…ymin#187) * feat: add per-provider additional scan folders (chattymin#177) Logs outside the built-in paths were a silent undercount for every provider except Claude. Store one list per provider so parsers never share folders, and only add custom roots — never evict a curated default. * fix: union custom scan roots onto every Antigravity default (chattymin#177) resolvedRoots hardcoded the CLI path, which is defaultRoots[1] after chattymin#182, so a no-root scan dropped 2.0/Core and IDE stores. Codex custom roots had the same class of hole against archived_sessions (chattymin#181).
Summary
LocalAntigravityUsageReaderpreviously looked only under~/.gemini/antigravity-cli/conversations/*.db. In Antigravity 2.0 and Antigravity IDE, conversation SQLite databases are saved under~/.gemini/antigravity/conversations/or~/.gemini/antigravity-ide/conversations/. Furthermore, modern Antigravity 2.0 sessions omitchat_start_metadata.created_atfrom the Protobuf blob, which caused modern conversation tokens to be silently dropped.This PR introduces comprehensive support for modern Antigravity 2.0 & IDE environments:
LocalAntigravityUsageReader.defaultRootschecks all candidate folders (antigravity,antigravity-cli, andantigravity-ide).stepstable viaresponse_id(1:1 direct correlation), falling back to in-orderexecution_idstep timings, and databasemtimeas a last resort, while rejecting invalid/overflow sentinels.response_idviaLocalUsageReader.dedupKeepMax, so multi-root discovery never double-counts spend.defaultRoot,scan(root:),entries(modifiedSince:root:), cache initializers) remain intact.UNUserNotificationCenter.requestAuthorizationwith asyncTaskto prevent a MainActor isolation crash (_dispatch_assert_queue_fail) when opening the popover for the first time on Swift 6 / macOS 15.README.md,README.ko.md,README.ja.md, and added Antigravity step timestamp correlation entry indocs/reference/defect-log.md.Design Decision & Grouping Rationale
We considered splitting this work into separate PRs, but decided to group them into a single cohesive PR for the following reasons:
Type of change
UI changes
~/.gemini/antigravity-cli/was scanned and sessions without Protobuf timestamps were dropped. Modern Antigravity 2.0 / IDE usage was undetected (0 tokens / Antigravity tab hidden).Acknowledgements
Special thanks to community contributors for their invaluable collaboration:
mtimedrift edge case and proposing thestepstable timeline recovery (#182 (comment)).response_idstep metadata correlation and contributing comprehensive edge-case regression tests (#190).Checklist
swift buildandswift testpass locallyTests
AntigravityUsageTests:testDefaultRootsContainsAllKnownLocations— assertsdefaultRootscontains all candidate directories (antigravity,antigravity-cli,antigravity-ide).testMultiRootScanDiscoversAndDeduplicatesAcrossDirectories— asserts all distinct records across roots are discovered and deduplicated.testCurrentGenerationFormatUsesStepMetadataTimestamp— assertsresponse_id1:1 step correlation.testMultipleGenerationsSharingExecutionIdAreCorrelatedByResponseId— asserts multi-turn correlations across midnight boundaries.testStepTimesAreHandedOutInOrderWithinAnExecution— asserts execution step timings fallback.testStoreMtimeRemainsTheLastResort— asserts fallback hierarchy (created_at→ stepresponse_id→ stepexecution_id→ storemtime).DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter AntigravityUsageTests: 47 tests, 0 failures.Full suite: 688 tests pass, 8 skipped, 0 failures.
🤖 Generated with Antigravity 2.0 (AGY 2.0)