Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: prevent Antigravity sessions from breaking session list#66

Merged
nigel-dev merged 3 commits intomaintokentopapp/tokentop:mainfrom
fix/issue-65-antigravity-listtokentopapp/tokentop:fix/issue-65-antigravity-listCopy head branch name to clipboard
Mar 8, 2026
Merged

fix: prevent Antigravity sessions from breaking session list#66
nigel-dev merged 3 commits intomaintokentopapp/tokentop:mainfrom
fix/issue-65-antigravity-listtokentopapp/tokentop:fix/issue-65-antigravity-listCopy head branch name to clipboard

Conversation

@nigel-dev
Copy link
Copy Markdown
Contributor

@nigel-dev nigel-dev commented Mar 7, 2026

Summary

Fix Antigravity agent sessions causing duplicate rows, broken row selection, and erratic scrolling (down 2, back up 1) in the sessions table.

Root cause: Both agent-antigravity and agent-gemini-cli scan the same ~/.gemini/tmp/ directory, producing duplicate AgentSessionAggregate entries for every session. This caused React key collisions (key={sessionId} on SessionRow), making the selector disappear and scrolling jump erratically.

Closes #65. Companion changes in agent-antigravity repo address cache key deduplication and session metadata.

Changes

  • Deduplicate sessions by sessionId in AgentSessionContext.tsx after combining results from all agent plugins — when two agents claim the same session, keep the richer aggregate (more streams, then more requests)
  • Remove scrollbox key remount hack (bulkCountRef + keyed <scrollbox>) in SessionsTable.tsx that was destroying scroll position and selection state on bulk changes
  • Raise bulkThreshold from 10 to 100 so loading Antigravity sessions no longer triggers false bulk-change detection
  • Add Gemini 3.x fallback pricing (gemini-3-flash-preview, gemini-3-pro-preview, gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview) to fallback.ts so those sessions display real costs instead of $0

Type

  • fix — Bug fix

Related issues

Closes #65

Testing

  • bun test passes (86 tests)
  • bun run typecheck passes (zero errors)
  • Manual verification (describe below)

Verified via TUI driver captures at 120-col and 160-col widths that Antigravity sessions were appearing as exact duplicate pairs (confirmed in repro-agent-asc.txt). Both agent-antigravity and agent-gemini-cli parse ~/.gemini/tmp/<hash>/chats/session-*.json, producing two aggregates per session. The dedup Map eliminates these duplicates before pricing and rendering.

Lint: 0 errors (pre-existing warnings only).

Raise useExitAnimation bulkThreshold from 10 to 50 so loading ~18
Antigravity sessions no longer triggers a scrollbox remount that
destroys selection state.  Add Gemini 3.x fallback pricing so those
sessions no longer cluster at $0 and break cost-based sorting.
Both agent-antigravity and agent-gemini-cli scan ~/.gemini/tmp/,
producing duplicate AgentSessionAggregate entries for the same
sessionId. This caused every Antigravity session to appear twice
in the session list, leading to React key collisions, broken row
selection, and erratic scrolling behavior.

- Deduplicate allAggregates by sessionId after combining all agent
  plugins, keeping the richer aggregate (more streams/requests)
- Remove scrollbox key remount hack (bulkCountRef) that was
  destroying scroll position on bulk changes
- Raise bulkThreshold from 50 to 100 to reduce false bulk triggers
Extract dedup logic from AgentSessionContext into a pure
deduplicateAggregates() function in aggregator.ts for testability.

Tests cover: empty input, unique sessions passthrough, exact
duplicates from overlapping agents, stream-count tiebreaker,
request-count tiebreaker, insertion-order stability, and mixed
unique/duplicate input. Also adds basic aggregateSessionUsage
tests for grouping, multi-stream splitting, and active/idle status.
@nigel-dev nigel-dev merged commit 93bbca8 into main Mar 8, 2026
6 checks passed
@nigel-dev nigel-dev deleted the fix/issue-65-antigravity-list branch March 8, 2026 08:26
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.

[Bug]: Antigravity agent sessions break session list selection and scrolling

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.