Skip to content

Antigravity usage omits the default instance's T3-managed profile #41151

Closed

Description

@soarkit

Summary

When Antigravity runs on its default provider instance, usage never counts the sessions that instance stores in its T3-managed profile. The default instance is the one the server synthesizes for the Antigravity driver and always passes to the usage reader with configured false, whether or not named Antigravity instances exist; a project can turn that instance on without creating a settings entry. Sessions started through it write their conversation databases under <stateDir>/providers/antigravity/<sha256(instanceId)>/antigravity-acp, but the usage reader only scans that path for instances that came from providerInstances, so those tokens never appear in Usage.

Environment

T3 Code server (apps/server) with the Antigravity provider enabled for a project and no providerInstances.antigravity entry in the server settings, so the usage reader receives the synthesized default instance.

Expected behavior

Usage includes the token history stored in the default instance's T3-managed profile, like it does for any explicitly configured instance.

Actual behavior

Reading usage for a server whose default Antigravity instance has history in its profile returns only the host data directories. The profile is not among the scanned sources, and the tokens in it are missing from the summary:

Default Antigravity instance enabled for the project: true

Antigravity scan roots:
/root/.gemini/antigravity/conversations
/root/.gemini/antigravity-cli
/root/.gemini/antigravity-ide
/root/.gemini/antigravity-backup
/root/.config/antigravity

Antigravity token buckets:
/root/.gemini/antigravity/conversations  11 output tokens

The profile at <stateDir>/providers/antigravity/<sha256("antigravity")>/antigravity-acp also contains a conversation with 7 output tokens in this run, and it is not scanned or counted.

Root cause

UsageService.usageInstances builds its entries from settings.providerInstances and marks those entries configured: true, then appends a synthesized entry for the driver's default instance with configured: false. AntigravityUsage.scan adds <profile>/antigravity-acp only for entries where instance.configured is true, so the default instance's profile is never resolved or read even though AntigravityDriver uses that same profile as GEMINI_HOME for every instance, including the default one.

The default Antigravity instance is disabled by default, but a project-level provider override can enable it (deriveProviderInstanceConfigMap keeps the synthesized instance alive and probes it), and that path does not add a providerInstances entry. The instance then runs and writes usage to a profile the usage reader skips.

Suggested fix

Resolve and scan the instance profile for every Antigravity instance instead of only for instance.configured, for example by removing the instances.filter((instance) => instance.configured) guard in AntigravityUsage.scan and resolving directories for all supplied instances. The scan already tolerates a missing profile directory and deduplicates canonical paths, so scanning the default instance's profile adds no duplicate sources when it does not exist.

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