feat: add Antigravity CLI and Gemini environment support#340
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14ae8f931d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| import { terminateProcessTree } from "./process.mjs"; | ||
|
|
||
| const PLUGIN_MANIFEST_URL = new URL("../../.claude-plugin/plugin.json", import.meta.url); | ||
| const PLUGIN_MANIFEST_URL = new URL("../../../../gemini-extension.json", import.meta.url); |
There was a problem hiding this comment.
Read manifest from plugin-scoped path
Load the manifest from a path that exists inside the shipped plugin bundle instead of ../../../../gemini-extension.json. The Claude marketplace entry publishes ./plugins/codex as the plugin source, so this relative lookup escapes that directory and fails with ENOENT when app-server.mjs is imported outside this repo layout, which breaks setup/review/task flows that initialize the app-server client.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81c1c84ab2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const VALID_REASONING_EFFORTS = new Set(["none", "minimal", "low", "medium", "high", "xhigh"]); | ||
| const MODEL_ALIASES = new Map([["spark", "gpt-5.3-codex-spark"]]); | ||
| const STOP_REVIEW_TASK_MARKER = "Run a stop-gate review of the previous Claude turn."; | ||
| const STOP_REVIEW_TASK_MARKER = "Run a stop-gate review of the previous Antigravity turn."; |
There was a problem hiding this comment.
Keep stop-gate marker aligned with prompt template text
buildTaskRunMetadata now detects stop-gate runs by looking for "Run a stop-gate review of the previous Antigravity turn.", but the shipped prompt template still starts with "Run a stop-gate review of the previous Claude turn." (plugins/codex/prompts/stop-review-gate.md). Because of this mismatch, stop-hook tasks are no longer tagged as Codex Stop Gate Review and are recorded as generic Codex Task, which changes status/reporting behavior and breaks the stop-gate flow expectations.
Useful? React with 👍 / 👎.
| You are the review command handler for the Codex plugin on Antigravity CLI. | ||
| Your goal is to run a normal, read-only Codex review on the current uncommitted changes or branch comparison. | ||
|
|
||
| Please find the companion script `codex-companion.mjs` under the `codex-plugin-agy/plugins/codex/scripts/` directory in the current workspace. |
There was a problem hiding this comment.
Remove repo-name-specific path from Antigravity commands
These new command prompts hardcode the companion script under codex-plugin-agy/plugins/codex/scripts/, but plugin installs/checkouts are not guaranteed to use that parent directory name (the current repo is codex-plugin-cc, and plugin source is plugins/codex). In environments where that folder name differs, the handler cannot resolve codex-companion.mjs, so /codex:* command execution fails with file-not-found before invoking Codex.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e93d99d5be
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Your goal is to run a normal, read-only Codex review on the current uncommitted changes or branch comparison. | ||
|
|
||
| Please find the companion script `codex-companion.mjs` under the `plugins/codex/scripts/` directory in the current workspace. | ||
| Execute the following command using the `run_command` tool: |
There was a problem hiding this comment.
Use Gemini's shell tool name in command prompts
Gemini CLI custom commands expose the shell executor as run_shell_command (per the Gemini shell-tool docs), not run_command; instructing the handler to use a non-existent tool means /review can fail at execution time with an unknown-tool path instead of invoking codex-companion.mjs. This affects normal Gemini extension installs where these TOML prompts are the runtime contract for command execution.
Useful? React with 👍 / 👎.
| You are the review command handler for the Codex plugin on Antigravity CLI. | ||
| Your goal is to run a normal, read-only Codex review on the current uncommitted changes or branch comparison. | ||
|
|
||
| Please find the companion script `codex-companion.mjs` under the `plugins/codex/scripts/` directory in the current workspace. |
There was a problem hiding this comment.
Resolve companion script from extension install path
This prompt tells the model to find plugins/codex/scripts/ under the current workspace, but Gemini extensions are loaded from the extension install directory (e.g. ~/.gemini/extensions/<name>), not from the project root. In a standard gemini extensions install flow, the workspace usually does not contain that path, so /review cannot locate codex-companion.mjs and fails before running Codex.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b4ee79817
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "name": "codex", | |||
| "version": "1.0.4", | |||
There was a problem hiding this comment.
Add Gemini manifest to version bump targets
The new gemini-extension.json introduces its own version field, but the release automation still only bumps/checks package.json, package-lock.json, plugins/codex/.claude-plugin/plugin.json, and .claude-plugin/marketplace.json (see scripts/bump-version.mjs TARGETS). After the next release bump, this file will remain stale, so Gemini installs can report outdated extension metadata even when the rest of the plugin is versioned correctly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a34946ec92
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| export const SESSION_ID_ENV = "CODEX_COMPANION_SESSION_ID"; | ||
| const PLUGIN_DATA_ENV = "CLAUDE_PLUGIN_DATA"; | ||
| const PLUGIN_DATA_ENV = process.env.ANTIGRAVITY_PLUGIN_DATA ? "ANTIGRAVITY_PLUGIN_DATA" : (process.env.GEMINI_PLUGIN_DATA ? "GEMINI_PLUGIN_DATA" : "CLAUDE_PLUGIN_DATA"); |
There was a problem hiding this comment.
Select plugin-data env var by active client context
PLUGIN_DATA_ENV is now chosen by checking whether ANTIGRAVITY_PLUGIN_DATA/GEMINI_PLUGIN_DATA are present, not by which client is actually running this hook. In a Claude session where GEMINI_PLUGIN_DATA happens to be exported in the process environment, this picks the Gemini path and handleSessionStart propagates the wrong data directory, so later status/result/cancel/cleanup logic reads and writes state in the wrong location. Please key this off the active runtime (or prefer CLAUDE_PLUGIN_DATA when present in Claude hooks) instead of cross-client env-var presence.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7dea7869e5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| Use the companion script from the installed Gemini extension at `${HOME}/.gemini/extensions/codex/scripts/codex-companion.mjs`. | ||
| Execute the following command using the `run_shell_command` tool: | ||
| `node "${HOME}/.gemini/extensions/codex/scripts/codex-companion.mjs" review {{args}}` |
There was a problem hiding this comment.
Point Gemini commands at the shipped companion script path
The command invokes node "${HOME}/.gemini/extensions/codex/scripts/codex-companion.mjs", but this commit does not ship scripts/codex-companion.mjs at the extension root (the companion lives under plugins/codex/scripts/). In a normal extension install that mirrors this repo layout, /review (and the other copied command files) will fail with ENOENT before Codex can run. Update the command path to the actual bundled script location.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bce2685a05
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Use the companion script from the installed Gemini extension at `${HOME}/.gemini/extensions/codex/plugins/codex/scripts/codex-companion.mjs`. | ||
| Execute the following command using the `run_shell_command` tool: | ||
| `node "${HOME}/.gemini/extensions/codex/plugins/codex/scripts/codex-companion.mjs" review {{args}}` |
There was a problem hiding this comment.
Point Gemini commands to the expected extension-root script
All new Gemini command TOMLs hardcode ~/.gemini/extensions/codex/plugins/codex/scripts/codex-companion.mjs, but this commit’s own command contract/test expects the companion at ~/.gemini/extensions/codex/scripts/codex-companion.mjs (tests/commands.test.mjs, “Gemini TOML commands…”). As shipped, /codex:* command handlers can resolve a non-existent path and fail with ENOENT before invoking Codex, and CI already catches this mismatch.
Useful? React with 👍 / 👎.
| const pluginDataEnv = process.env.CLAUDE_PLUGIN_DATA ? "CLAUDE_PLUGIN_DATA" : (process.env.GEMINI_PLUGIN_DATA ? "GEMINI_PLUGIN_DATA" : "ANTIGRAVITY_PLUGIN_DATA"); | ||
| const pluginDataDir = process.env[pluginDataEnv]; |
There was a problem hiding this comment.
Derive plugin-data path from active client context
resolveStateDir now selects CLAUDE_PLUGIN_DATA/GEMINI_PLUGIN_DATA/ANTIGRAVITY_PLUGIN_DATA solely by whichever env var is present first, not by which client is running this process. In mixed shells where multiple client env vars are exported, state can be written to the wrong client directory, so later status/result/cancel lookups read a different state tree and miss or cross-contaminate jobs.
Useful? React with 👍 / 👎.
Summary
This PR adds support for Antigravity CLI and Gemini-based developer environments, transforming this plugin into a unified multi-client companion for both Claude Code and Antigravity/Gemini terminals.
Changes
CLAUDE,ANTIGRAVITY, andGEMINIenvironment flags..claude-pluginhooks while co-locatinggemini-extension.jsonconfiguration andcommands/declarations.Verification
npm run test(all tests passing)npm run build