Skip to content

feat: add Antigravity CLI and Gemini environment support#340

Open
EladAriel wants to merge 8 commits into
openai:mainfrom
EladAriel:feat/antigravity-support
Open

feat: add Antigravity CLI and Gemini environment support#340
EladAriel wants to merge 8 commits into
openai:mainfrom
EladAriel:feat/antigravity-support

Conversation

@EladAriel
Copy link
Copy Markdown

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

  • Multi-Client Detection: Restructured session initialization and stop-hooks to dynamically detect CLAUDE, ANTIGRAVITY, and GEMINI environment flags.
  • Client Coexistence: Retained all original .claude-plugin hooks while co-locating gemini-extension.json configuration and commands/ declarations.
  • Dynamic Context Rendering: Dynamic detection changes prompts and stop review markers depending on the active companion client.
  • Test Resilience: Updated tests to handle either client environment cleanly.

Verification

  • Run local test suite: npm run test (all tests passing)
  • Verified build: npm run build
  • Verified dynamic routing under both client setups.

@EladAriel EladAriel requested a review from a team May 20, 2026 09:56
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: 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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👍

Comment thread plugins/codex/scripts/stop-review-gate-hook.mjs Outdated
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: 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.";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread commands/review.toml Outdated
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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: 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".

Comment thread commands/review.toml Outdated
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:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread commands/review.toml Outdated
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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: 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".

Comment thread gemini-extension.json
@@ -0,0 +1,6 @@
{
"name": "codex",
"version": "1.0.4",
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 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 👍 / 👎.

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: 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");
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 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 👍 / 👎.

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: 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".

Comment thread commands/review.toml Outdated

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}}`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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: 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".

Comment thread commands/review.toml
Comment on lines +6 to +8
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}}`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread plugins/codex/scripts/lib/state.mjs Outdated
Comment on lines +41 to +42
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];
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 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 👍 / 👎.

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.

1 participant