feat(antigravity): Add Antigravity plugin provider#91
Conversation
…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.
Add Antigravity provider plugin and wire
|
There was a problem hiding this comment.
💡 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".
| var resp = ctx.host.http.request({ | ||
| method: "POST", | ||
| url: "http://127.0.0.1:" + port + "/" + LS_SERVICE + "/" + method, | ||
| headers: { |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
- 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>
| opts.markers | ||
| ); | ||
|
|
||
| let ps_output = match std::process::Command::new("/bin/ps") |
There was a problem hiding this comment.
🟢 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".
| let has_marker = markers_lower.iter().any(|m| { | ||
| command_lower.contains(&format!("--app_data_dir {}", m)) | ||
| || command_lower.contains(&format!("/{}/", m)) | ||
| }); |
There was a problem hiding this comment.
🟡 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.
| 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".
Closes #14
Adds an Antigravity (Google Gemini Code Assist) plugin that probes the local language server for per-model quota data.
Changes
ctx.host.ls.discover()— scoped process/port discovery viaps+lsof, not a general exec. Extracts CSRF token and listening ports from the LS process args.GetUnleashData, callsGetUserStatus(fallback toGetCommandModelConfigs), emits per-model quota lines sorted Gemini > Claude > others with 5h pacing window.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 toGetCommandModelConfigs), emitting sorted/deduped progress lines with a 5-hour quota window.Extends the Tauri plugin host API with
ctx.host.ls.discover()(implemented via constrainedps+lsofparsing 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
Migration
Written for commit 78460ee. Summary will update on new commits.