fix(antigravity): LS process name for v2.0.6+ + segmented progress bars#509
fix(antigravity): LS process name for v2.0.6+ + segmented progress bars#509sakn0m wants to merge 5 commits into
Conversation
….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
There was a problem hiding this comment.
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
segmentsfor 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.
| indicatorColor={line.color} | ||
| markerValue={paceMarkerValue} | ||
| refreshing={refreshing} | ||
| segments={"segments" in line ? (line as any).segments : undefined} |
| } | ||
| : undefined | ||
|
|
||
| const segmentCount = segments && segments > 1 ? segments : 0 |
| {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; |
| resetsAt?: string | ||
| periodDurationMs?: number | ||
| color?: string | ||
| segments?: number |
| segments: line | ||
| .get::<_, Option<u32>>("segments") | ||
| .unwrap_or(None) | ||
| .filter(|&s| s >= 2), |
|
thank you. this seems like a bigger (core) change. could you attach some screenshot/s? cheers! |
a6b5dd1 to
52ab16b
Compare
There was a problem hiding this comment.
2 issues found across 7 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
- 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)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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>

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_macostolanguage_server. Discovery was failing because the plugin looked for the old name. Usinglanguage_serveris 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.
segmentsfield toMetricLine::Progress(Rust + TypeScript + host API)ProgressUI component whensegmentsis setsegments: 5Testing