Skip to content

feat(antigravity): Add Antigravity plugin provider#91

Merged
robinebers merged 2 commits into
mainfrom
feat/antigravity-provider
Feb 7, 2026
Merged

feat(antigravity): Add Antigravity plugin provider#91
robinebers merged 2 commits into
mainfrom
feat/antigravity-provider

Conversation

@robinebers
Copy link
Copy Markdown
Owner

@robinebers robinebers commented Feb 7, 2026

Closes #14

Adds an Antigravity (Google Gemini Code Assist) plugin that probes the local language server for per-model quota data.

Changes

  • New host API ctx.host.ls.discover() — scoped process/port discovery via ps + lsof, not a general exec. Extracts CSRF token and listening ports from the LS process args.
  • Antigravity plugin — discovers the Codeium language server, probes ports with GetUnleashData, calls GetUserStatus (fallback to GetCommandModelConfigs), emits per-model quota lines sorted Gemini > Claude > others with 5h pacing window.
  • Provider docs — reverse-engineered LS protocol docs focused on what the plugin uses.
  • Cursor test fix — updated 2 stale test assertions to match current error message.

Made with Cursor


Note

Medium Risk
Introduces a new host capability that inspects local processes and open ports via ps/lsof, which could affect security posture and platform compatibility (currently macOS-oriented). The rest is additive plugin/docs/test changes with limited impact outside the plugin engine.

Overview
Adds a new Antigravity provider plugin that discovers the IDE’s local language server, probes for a working Connect-RPC port, and fetches per-model quota via GetUserStatus (with fallback to GetCommandModelConfigs), emitting sorted/deduped progress lines with a 5-hour quota window.

Extends the Tauri plugin host API with ctx.host.ls.discover() (implemented via constrained ps + lsof parsing and CSRF/port extraction) and wires its JS wrapper into the runtime; updates test scaffolding accordingly. Also adds provider documentation and an icon/manifest for the new plugin, and adjusts Cursor’s “usage disabled” error message plus its test assertions.

Written by Cursor Bugbot for commit 78460ee. This will update automatically on new commits. Configure here.


Summary by cubic

Adds an Antigravity provider that discovers the local language server and shows per‑model quota usage in the app. Introduces a scoped LS discovery host API and wires it into the runtime; closes #14.

  • New Features

    • Antigravity plugin: finds the Codeium LS, probes ports via GetUnleashData, fetches quotas with GetUserStatus (fallback to GetCommandModelConfigs), and outputs per‑model progress lines (5h window), ordered Gemini → Claude → others.
    • Host API: ctx.host.ls.discover for process/port discovery (ps + lsof), extracting CSRF and optional extension port; runtime wrapper added.
    • Hardening: check lsof exit status; fall back to extensionPort on probe failure; wrap GetUserStatus in try/catch with fallback; guard JSON.stringify in LS wrapper; defensive guard on discovery.ports.
    • Docs: provider protocol notes for the endpoints and headers the plugin uses.
    • Tests: coverage for discovery, sorting, de‑dupe, fallbacks; test helpers updated.
    • Cursor: clarified error message (“No active Cursor subscription.”) and updated tests.
  • Migration

    • No config changes. Start Antigravity to surface usage data.

Written for commit 78460ee. Summary will update on new commits.

…ation

- Introduced a new Antigravity plugin that connects to the language server using Connect RPC v1.
- Implemented LS discovery, including CSRF token extraction and port probing.
- Added endpoints for retrieving user status and model configurations.
- Created a detailed documentation file outlining the plugin's functionality and usage.
- Included an SVG icon for the Antigravity plugin.
- Enhanced test coverage for the plugin's functionality and error handling.
- Sneaking in a Cursor plugin string update here too. Oops. Don't tell anyone.
@macroscopeapp
Copy link
Copy Markdown

macroscopeapp Bot commented Feb 7, 2026

Add Antigravity provider plugin and wire host.ls.discover into the JS plugin runtime for local language server quota reporting

Introduce the Antigravity provider with a JS plugin, tests, manifest, and docs; add runtime host API support for ctx.host.ls.discover including CSRF and port discovery; update Cursor plugin error text. Key entry points: plugins/antigravity/plugin.js, src-tauri/src/plugin_engine/host_api.rs, and src-tauri/src/plugin_engine/runtime.rs.

📍Where to Start

Start with the host API injection and wrapper in src-tauri/src/plugin_engine/host_api.rs, then follow the runtime integration in src-tauri/src/plugin_engine/runtime.rs, and finally review the probe flow in plugins/antigravity/plugin.js.


Macroscope summarized 78460ee.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ecfa3c1d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +51 to +54
var resp = ctx.host.http.request({
method: "POST",
url: "http://127.0.0.1:" + port + "/" + LS_SERVICE + "/" + method,
headers: {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle HTTPS LS endpoints, not just HTTP

The new Antigravity plugin hardcodes http://127.0.0.1 for language-server requests. If the LS is configured to serve HTTPS (self‑signed cert is common for local LS processes), the probe and subsequent calls will fail with connection errors and the plugin will always throw “Start Antigravity and try again.” This is an environment-dependent failure introduced by the new provider; consider trying HTTPS when HTTP fails (or probing both schemes) to avoid false negatives on HTTPS-only LS setups.

Useful? React with 👍 / 👎.

Comment thread src-tauri/src/plugin_engine/host_api.rs Outdated
Comment thread src-tauri/src/plugin_engine/host_api.rs Outdated
Comment thread plugins/antigravity/plugin.js Outdated
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 10 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src-tauri/src/plugin_engine/host_api.rs">

<violation number="1" location="src-tauri/src/plugin_engine/host_api.rs:811">
P2: Missing exit status check for `lsof` command. Unlike the `ps` command handling above, this doesn't verify `lsof_output.status.success()` before parsing stdout. If `lsof` fails (e.g., permission denied, process terminated), the code will attempt to parse potentially invalid output.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src-tauri/src/plugin_engine/host_api.rs Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread src-tauri/src/plugin_engine/host_api.rs
Comment thread plugins/antigravity/plugin.js
- C1: check lsof exit status before parsing; fall through to extensionPort on failure
- C2: wrap GetUserStatus in try/catch so exceptions fall back to GetCommandModelConfigs
- C4: guard JSON.stringify in LS wrapper against non-serializable opts
- C5: defensive guard on discovery.ports

Co-authored-by: Cursor <cursoragent@cursor.com>
@robinebers robinebers merged commit 01d81ce into main Feb 7, 2026
3 checks passed
opts.markers
);

let ps_output = match std::process::Command::new("/bin/ps")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Low

plugin_engine/host_api.rs:713 Unlike the lsof lookup below, ps is hardcoded to /bin/ps with no fallback. Consider checking multiple paths (e.g., /bin/ps, /usr/bin/ps) for consistency across Linux distributions and macOS versions.

-                let ps_output = match std::process::Command::new("/bin/ps")
+                let ps_path = ["/bin/ps", "/usr/bin/ps"]
+                    .iter()
+                    .find(|p| std::path::Path::new(p).exists());
+
+                let ps_bin = match ps_path {
+                    Some(p) => *p,
+                    None => {
+                        log::warn!("[plugin:{}] ps not found", pid);
+                        return Ok("null".to_string());
+                    }
+                };
+
+                let ps_output = match std::process::Command::new(ps_bin)

🚀 Want me to fix this? Reply ex: "fix it for me".

Comment on lines +761 to +764
let has_marker = markers_lower.iter().any(|m| {
command_lower.contains(&format!("--app_data_dir {}", m))
|| command_lower.contains(&format!("/{}/", m))
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium

plugin_engine/host_api.rs:761 Marker matching only handles --app_data_dir {m} (space-separated). Consider also matching --app_data_dir={m} (equals format) to handle both common CLI styles.

Suggested change
let has_marker = markers_lower.iter().any(|m| {
command_lower.contains(&format!("--app_data_dir {}", m))
|| command_lower.contains(&format!("/{}/", m))
});
let has_marker = markers_lower.iter().any(|m| {
command_lower.contains(&format!("--app_data_dir {}", m))
|| command_lower.contains(&format!("--app_data_dir={}", m))
|| command_lower.contains(&format!("/{}/", m))
});

🚀 Want me to fix this? Reply ex: "fix it for me".

@robinebers robinebers deleted the feat/antigravity-provider branch February 7, 2026 11:07
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.

Add Antigravity plugin provider

1 participant