Skip to content

[Bug]: Antigravity usage disappears for removed provider instances and extra profile dirs under providers/antigravity/ #43514

Done

Description

@Luzivog

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Configure a second Antigravity provider instance (e.g. antigravity-2) in Settings and run several turns on it so conversation databases are written under <stateDir>/providers/antigravity/<sha256("antigravity-2")>/antigravity-acp/conversations/*.db.
  2. Open Usage → Tokens / Cost and confirm the turns appear in the Antigravity totals.
  3. Remove antigravity-2 from providerInstances (for example after consolidating accounts or retiring a secondary instance). The profile directory and its conversations/*.db files remain on disk under <stateDir>/providers/antigravity/.
  4. Re-open Usage → Tokens / Cost (or wait for the next scan).

Expected behavior

Historical Antigravity usage stored under <stateDir>/providers/antigravity/*/antigravity-acp/conversations/*.db continues to be counted on the Usage screen even after a provider instance is removed, renamed, or routed to another profile directory under <stateDir>/providers/antigravity/.

Actual behavior

All usage recorded under the removed instance's profile directory vanishes immediately from the Usage charts and totals.

In apps/server/src/provider/Drivers/AntigravityUsage.ts, AntigravityUsage.scan only adds profile roots by iterating the currently configured instances and computing resolveAntigravityInstanceDirectories(host.paths.stateDir, instanceId).profile + "/antigravity-acp":

  • Any profile directory under <stateDir>/providers/antigravity/* whose instanceId is no longer in settings.providerInstances (or any extra profile directory stored under <stateDir>/providers/antigravity/ by a custom binaryPath wrapper) is never scanned.
  • Unlike Claude Code (~/.claude/projects) or Codex (~/.codex/sessions), whose historical transcripts survive provider reconfiguration because the scanner walks the shared root, Antigravity history silently disappears as soon as an instance is removed.

Suggested fix: In AntigravityUsage.scan, also list immediate subdirectories of <stateDir>/providers/antigravity/ that contain an antigravity-acp directory and include <dir>/antigravity-acp in the scanned roots (deduplicated through the existing conversationDirs Set and realPath normalization).

Impact

Minor bug or occasional failure

Version or commit

0.1.13-nightly.20261125.5245

Environment

Linux x86_64, T3 Code server 0.1.13-nightly.20261125.5245, Antigravity ACP 1.5.16

Logs or stack traces

# On disk under ~/.t3/userdata/providers/antigravity/:
# - ac0a3dfd... (active `antigravity` instance): scanned
# - 97f81140..., 404f29b3..., 373bb5ce... (previously configured instances): omitted by AntigravityUsage.scan once removed from providerInstances

Workaround

Set ANTIGRAVITY_DATA_DIR on providerInstances.antigravity.environment to a comma-separated list of the <profileDir>/antigravity-acp directories that should remain visible in Usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions