Skip to content

fix(antigravity): LS process name for v2.0.6+ + segmented progress bars#509

Open
sakn0m wants to merge 5 commits into
robinebers:mainfrom
sakn0m:fix/antigravity-ls-process-name
Open

fix(antigravity): LS process name for v2.0.6+ + segmented progress bars#509
sakn0m wants to merge 5 commits into
robinebers:mainfrom
sakn0m:fix/antigravity-ls-process-name

Conversation

@sakn0m
Copy link
Copy Markdown

@sakn0m sakn0m commented May 25, 2026

This PR builds on #508 by @kvanzuijlen — credits to them for the initial Antigravity IDE v2 support (v1/v2 DB path detection + IDE marker discovery).

What

Two additional improvements for the Antigravity plugin:

1. Fix LS process discovery

Antigravity v2.0.6 renamed the language server binary from language_server_macos to language_server. Discovery was failing because the plugin looked for the old name. Using language_server is backwards-compatible (substring match covers both names).

2. Segmented progress bar

Antigravity reports quota in 5 discrete steps (0%/20%/40%/60%/80%/100%). Added 4 divider lines to the progress bar so the visual matches the granularity of the data.

  • Adds segments field to MetricLine::Progress (Rust + TypeScript + host API)
  • Renders divider lines in the Progress UI component when segments is set
  • Antigravity plugin sets segments: 5

Testing

  • Plugin tests: 59/59 pass
  • Manual test with Antigravity v2.0.6 — LS discovery works, usage data displays correctly
  • Segmented bar renders properly in the UI

kvanzuijlen and others added 4 commits May 25, 2026 01:08
….0.6+

Antigravity v2.0.6 renamed the LS binary from 'language_server_macos' to
'language_server'. The existing discovery failed because the process name
didn't match. Using 'language_server' as the process name is
backwards-compatible since both binary names contain this substring.
- Fix LS discovery: use 'language_server' instead of 'language_server_macos'
  to support Antigravity v2.0.6+ which renamed the binary
- Add 5-segment dividers to Antigravity progress bars to match the
  5-step quota granularity (0/20/40/60/80/100%)
- Add 'segments' field to MetricLine::Progress, host API, plugin types,
  and Progress UI component
Copilot AI review requested due to automatic review settings May 25, 2026 11:45
@github-actions github-actions Bot added rust Pull requests that update rust code core plugin labels May 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for segmented progress bars in metric lines and improves the Antigravity plugin’s ability to locate OAuth tokens across v1/v2 database locations.

Changes:

  • Extend metric line schema (TS + Rust) with optional segments for progress metrics.
  • Render visual segment dividers in the Progress UI component.
  • Update Antigravity plugin to probe v2 DB path first with fallback behavior, and add tests around path selection/fallback.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/lib/plugin-types.ts Extends the plugin-facing TS metric line type to include segments.
src/components/ui/progress.tsx Adds segmented divider rendering to the progress bar UI.
src/components/provider-card.tsx Passes segments from metric lines into the Progress component.
src-tauri/src/plugin_engine/runtime.rs Adds segments to Rust metric parsing and filters invalid values.
src-tauri/src/plugin_engine/host_api.rs Allows JS host API to set segments on progress lines.
plugins/antigravity/plugin.js Probes v2 DB first for OAuth tokens, falls back to v1; updates LS discovery and emits segmented quota line.
plugins/antigravity/plugin.test.js Adds tests for v2/v1 DB path selection and fallback behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/provider-card.tsx Outdated
indicatorColor={line.color}
markerValue={paceMarkerValue}
refreshing={refreshing}
segments={"segments" in line ? (line as any).segments : undefined}
}
: undefined

const segmentCount = segments && segments > 1 ? segments : 0
Comment on lines +55 to +64
{segmentCount > 0 &&
Array.from({ length: segmentCount - 1 }).map((_, i) => (
<div
key={i}
data-slot="progress-segment"
aria-hidden="true"
className="absolute top-0 bottom-0 w-px z-10 pointer-events-none bg-background/50"
style={{ left: `${((i + 1) * 100) / segmentCount}%` }}
/>
))}
if (opts.resetsAt) line.resetsAt = opts.resetsAt;
if (opts.periodDurationMs) line.periodDurationMs = opts.periodDurationMs;
if (opts.color) line.color = opts.color;
if (opts.segments) line.segments = opts.segments;
Comment thread src/lib/plugin-types.ts
resetsAt?: string
periodDurationMs?: number
color?: string
segments?: number
Comment thread src-tauri/src/plugin_engine/runtime.rs Outdated
Comment on lines +415 to +418
segments: line
.get::<_, Option<u32>>("segments")
.unwrap_or(None)
.filter(|&s| s >= 2),
@robinebers
Copy link
Copy Markdown
Owner

thank you. this seems like a bigger (core) change.

could you attach some screenshot/s? cheers!

@sakn0m
Copy link
Copy Markdown
Author

sakn0m commented May 25, 2026

The main reason for the progress bar changes: Antigravity reports quota in discrete 20% steps (remainingFraction jumps from 1.0 → 0.8 → 0.6 → 0.4 → 0.2 → 0.0). The bar was continuous before. The 4 dividers make this visible.
The other change is just renaming the process to retrieve usage data since Antigravity v2.0.6 renamed the language server binary from language_server_macos to language_server, so discovery was broken.

Screenshot 2026-05-25 alle 16 15 54

This is the only attachment since only Antigravity's section was changed.
Note: I haven't yet managed to make the plugin work with Antigravity CLI, only with Antigravity 2.0 GUI.

@sakn0m sakn0m force-pushed the fix/antigravity-ls-process-name branch from a6b5dd1 to 52ab16b Compare May 25, 2026 14:33
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 7 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src-tauri/src/plugin_engine/runtime.rs Outdated
Comment thread plugins/antigravity/plugin.js
- Add agy CLI LS discovery via log file (~/.gemini/antigravity-cli/log/)
  agy uses random ports announced in cli-*.log; discoverAgyPorts parses
  the latest log, probeAgyLs uses those ports (no CSRF required)
- Add listDir host API (Rust + test mock) for log directory listing
- Fix loadOAuthTokens: return null on empty/missing token instead of
  falling through to stale V1 creds (fail LOUD, no silent fallbacks)
- Clamp segments to [2, 20] in runtime.rs (prevents excessive DOM nodes)
- Remove (line as any).segments cast in provider-card.tsx (TS narrows via
  discriminated union)
- Add CLI-specific tests (port discovery, token refresh via CLI creds)
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/antigravity/plugin.js">

<violation number="1" location="plugins/antigravity/plugin.js:109">
P2: Early `return null` in `loadOAuthTokens` removes v1 DB fallback when v2 DB exists but contains invalid/missing token data</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

"SELECT value FROM ItemTable WHERE key = '" + OAUTH_TOKEN_KEY + "' LIMIT 1"
)
var parsed = ctx.util.tryParseJson(rows)
if (!parsed || !parsed.length || !parsed[0].value) return null
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Early return null in loadOAuthTokens removes v1 DB fallback when v2 DB exists but contains invalid/missing token data

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/antigravity/plugin.js, line 109:

<comment>Early `return null` in `loadOAuthTokens` removes v1 DB fallback when v2 DB exists but contains invalid/missing token data</comment>

<file context>
@@ -106,9 +106,9 @@
         )
         var parsed = ctx.util.tryParseJson(rows)
-        if (!parsed || !parsed.length || !parsed[0].value) continue
+        if (!parsed || !parsed.length || !parsed[0].value) return null
         var inner = unwrapOAuthSentinel(ctx, parsed[0].value)
-        if (!inner) continue
</file context>
Fix with Cubic

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

Labels

core plugin rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants