[GH-ISSUE #7567] [Bug] Antigravity setup creates the evidence that makes broad setup select Gemini CLI #4505

Open
opened 2026-10-31 00:50:21 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @coygeek on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/7567

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Setup, packaging, or upgrade

Observed behavior

In an empty isolated home, node scripts/rea.mjs setup --client antigravity --skill=false --yes --json creates Antigravity's MCP configuration. The next setup --all-detected --skill=false --dry-run --json identifies Gemini CLI as detected and proposes a new Gemini CLI registration. Applying that broad plan with --yes creates .gemini/settings.json containing mcpServers.rea and returns ready.

No Gemini CLI configuration or marker existed before the Antigravity command. Immediately afterward, the only file in the isolated home was .gemini/config/mcp_config.json. A blank-home broad dry-run selected no clients.

Reproduction

  1. Use the built source baseline below with Node.js 24.22.1 selected directly on PATH. Set TMPDIR to a disposable verification directory. Run this Python fixture from the repository root. It supplies an environment allowlist, runs REA inside a temporary home, and removes that home afterward:
import json
import os
from pathlib import Path
import shutil
import subprocess
import tempfile

entry = Path("scripts/rea.mjs").resolve()
node = shutil.which("node")
assert node is not None
with tempfile.TemporaryDirectory(prefix="rea-detection-", dir=os.environ["TMPDIR"]) as root:
    home = Path(root)
    env = {
        "PATH": str(Path(node).parent) + os.pathsep + os.defpath,
        "HOME": str(home), "NO_COLOR": "1", "TMPDIR": str(home),
        "XDG_CONFIG_HOME": str(home / "config"),
        "XDG_DATA_HOME": str(home / "data"),
        "XDG_CACHE_HOME": str(home / "cache"),
        "XDG_STATE_HOME": str(home / "state"),
        "npm_config_prefix": str(home / "npm-global"),
    }

    def run(label, *args):
        result = subprocess.run([node, str(entry), *args], cwd=home, env=env,
                                capture_output=True, text=True, check=False)
        assert result.returncode == 0, (label, result.returncode, result.stderr)
        data = json.loads(result.stdout)
        print(label, json.dumps({
            "status": data["status"],
            "planned": [action["id"] for action in data["plannedActions"]],
            "applied": data["appliedActions"],
            "detected": [state["client"]["name"] for state in data["clientStates"]
                         if state["detected"]],
            "files": sorted(str(p.relative_to(home)) for p in home.rglob("*") if p.is_file()),
        }))
        return data

    run("empty", "setup", "--all-detected", "--skill=false", "--dry-run", "--json")
    run("antigravity", "setup", "--client", "antigravity", "--skill=false", "--yes", "--json")
    assert not (home / ".gemini/settings.json").exists()
    run("broad-plan", "setup", "--all-detected", "--skill=false", "--dry-run", "--json")
    run("explicit-plan", "setup", "--client", "antigravity", "--skill=false", "--dry-run", "--json")
    assert not (home / ".gemini/settings.json").exists()
    run("broad-apply", "setup", "--all-detected", "--skill=false", "--yes", "--json")
    settings = json.loads((home / ".gemini/settings.json").read_text())
    assert "rea" in settings["mcpServers"]
    print("Gemini settings contains mcpServers.rea:", True)
  1. Compare empty with broad-plan: the latter reports both gemini_cli and antigravity as detected and plans configure_client:gemini_cli despite the absence of Gemini settings.
  2. Inspect broad-apply: it adds .gemini/settings.json, and the final assertion verifies mcpServers.rea. explicit-plan demonstrates that explicit Antigravity scope avoids the extra write.

The main sequence reproduced in two fresh isolated homes and again in the self-cleaning fixture above, for three successful reproductions.

Expected behavior

The documented broad scope should select clients with applicable client-specific configuration or installation-marker evidence. REA-created Antigravity configuration should not by itself identify Gemini CLI as present.

The installation guide permits selecting a client before it has a detected configuration and defines --all-detected as configuring detected supported clients. Directory markers are supported evidence; executable-package verification is not required. The client guide explicitly distinguishes a product's own profile evidence from shared directories REA creates, using FreeBuff as the documented example. The detection helper's contract makes the same distinction between product applicability and shared registration ownership.

The guides document Antigravity's nested destination and Gemini CLI's separate settings file, but do not document Antigravity setup opting Gemini CLI into automatic discovery. Source and documentation locators appear below.

Impact and scope

P2: the observed consequence is a repeatable extra client configuration write during broad setup, making its detected-client scope inaccurate. Explicit --client antigravity --skill=false provides a verified practical workaround: the subsequent explicit dry-run planned no changes and left Gemini settings absent.

The broad write remains visible in the dry-run plan and requires the caller's approval. No data loss or security-boundary crossing was observed. Only REA's public CLI and filesystem effects on macOS were tested; actual Gemini CLI/Antigravity loading, Windows, and Linux remain untested.

REA version

Exact node scripts/rea.mjs --version output:

6.8.0

Source baseline: 65f1c447344a423fa2785847dbcea1e9a9e2454a.

Runtime and platform

Node.js v24.22.1; macOS 27.0.1; Darwin arm64. No analysis provider or model session was used.

Target and artifact context

No analysis target. The fixture starts with an empty isolated home; its initial client configuration comes entirely from explicit Antigravity setup.

Interface

CLI

Earliest failure stage

Setup or provider admission

Relevant output or evidence

Reduced output from the executed fixture; file paths are relative to its isolated home:

empty: planned; detected=[]; planned=[]; files=[]
antigravity: ready; applied=[configured_antigravity]; files=[.gemini/config/mcp_config.json]
broad-plan: planned; detected=[gemini_cli, antigravity]; planned=[configure_client:gemini_cli]
explicit-plan: planned; planned=[]; files=[.gemini/config/mcp_config.json]
broad-apply: ready; applied=[configured_gemini_cli]; files=[.gemini/config/mcp_config.json, .gemini/settings.json]
Gemini settings contains mcpServers.rea: True

Every CLI invocation exited 0. The broad dry-run left Gemini settings absent; the apply created them.

Contract locators at the baseline: docs/installation.md:40-44,120-125,138-148; docs/client-configuration.md:349-358,630-638; src/application/SupportedClients.ts:763-804.

Failure locators: Gemini CLI's parent-directory marker is defined in src/application/SupportedClients.ts:556-565, while Antigravity's nested write destination is defined at :590-597. Detection accepts an existing evidence path in src/application/SetupHost.ts:485-517. Broad selection consumes the detected IDs in src/application/Setup.ts:153-161.

Typed outcome or recovery expected

After Antigravity-only setup in this fixture, a broad dry-run should leave Gemini CLI outside automatic selection and propose no Gemini settings write. Explicitly selecting Gemini CLI should remain available.

Analysis or suspected cause

Source-derived explanation: creating .gemini/config/mcp_config.json also creates .gemini, which is Gemini CLI's detection marker. The discovery helper accepts the existence of that parent even when its only content belongs to Antigravity. The registration and detection paths therefore allow one client's configuration write to manufacture another client's applicability evidence.

A correction should distinguish the two products' discovery evidence while preserving explicit configuration of a client before its marker exists. No particular replacement marker was tested.

Additional context

Related reports checked include #7522, concerning automatic selection of Grok Bot's manual hosted connector, and #5443/merged #5508, concerning loss of an explicit client when combined with broad selection. Their triggers and required outcomes differ.

Open PR #5145, head e939e4547cb9e07a20d1f660f8ce3add4946f034, replaces closed #3249 and separates Antigravity IDE/CLI evidence. Inspection of its detection changes shows overrides for those two surfaces only. Gemini CLI retains the .gemini marker, and the common helper still uses ordinary marker/config evidence when no override is supplied. Consequently the parent-directory collision described here remains under that proposed implementation. This is source analysis of the PR; its runtime was not executed.

Issue #3243 and merged PR #2736 address the analogous shared-storage distinction for FreeBuff, using FreeBuff-specific discovery paths. They do not change Gemini CLI's marker. No existing report with this Antigravity-to-Gemini trigger and closure condition was found in the open/closed issue, PR, and comment searches. No last-known-good revision was established.

Originally created by @coygeek on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/7567 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Setup, packaging, or upgrade ### Observed behavior In an empty isolated home, `node scripts/rea.mjs setup --client antigravity --skill=false --yes --json` creates Antigravity's MCP configuration. The next `setup --all-detected --skill=false --dry-run --json` identifies Gemini CLI as detected and proposes a new Gemini CLI registration. Applying that broad plan with `--yes` creates `.gemini/settings.json` containing `mcpServers.rea` and returns `ready`. No Gemini CLI configuration or marker existed before the Antigravity command. Immediately afterward, the only file in the isolated home was `.gemini/config/mcp_config.json`. A blank-home broad dry-run selected no clients. ### Reproduction 1. Use the built source baseline below with Node.js 24.22.1 selected directly on `PATH`. Set `TMPDIR` to a disposable verification directory. Run this Python fixture from the repository root. It supplies an environment allowlist, runs REA inside a temporary home, and removes that home afterward: ```python import json import os from pathlib import Path import shutil import subprocess import tempfile entry = Path("scripts/rea.mjs").resolve() node = shutil.which("node") assert node is not None with tempfile.TemporaryDirectory(prefix="rea-detection-", dir=os.environ["TMPDIR"]) as root: home = Path(root) env = { "PATH": str(Path(node).parent) + os.pathsep + os.defpath, "HOME": str(home), "NO_COLOR": "1", "TMPDIR": str(home), "XDG_CONFIG_HOME": str(home / "config"), "XDG_DATA_HOME": str(home / "data"), "XDG_CACHE_HOME": str(home / "cache"), "XDG_STATE_HOME": str(home / "state"), "npm_config_prefix": str(home / "npm-global"), } def run(label, *args): result = subprocess.run([node, str(entry), *args], cwd=home, env=env, capture_output=True, text=True, check=False) assert result.returncode == 0, (label, result.returncode, result.stderr) data = json.loads(result.stdout) print(label, json.dumps({ "status": data["status"], "planned": [action["id"] for action in data["plannedActions"]], "applied": data["appliedActions"], "detected": [state["client"]["name"] for state in data["clientStates"] if state["detected"]], "files": sorted(str(p.relative_to(home)) for p in home.rglob("*") if p.is_file()), })) return data run("empty", "setup", "--all-detected", "--skill=false", "--dry-run", "--json") run("antigravity", "setup", "--client", "antigravity", "--skill=false", "--yes", "--json") assert not (home / ".gemini/settings.json").exists() run("broad-plan", "setup", "--all-detected", "--skill=false", "--dry-run", "--json") run("explicit-plan", "setup", "--client", "antigravity", "--skill=false", "--dry-run", "--json") assert not (home / ".gemini/settings.json").exists() run("broad-apply", "setup", "--all-detected", "--skill=false", "--yes", "--json") settings = json.loads((home / ".gemini/settings.json").read_text()) assert "rea" in settings["mcpServers"] print("Gemini settings contains mcpServers.rea:", True) ``` 2. Compare `empty` with `broad-plan`: the latter reports both `gemini_cli` and `antigravity` as detected and plans `configure_client:gemini_cli` despite the absence of Gemini settings. 3. Inspect `broad-apply`: it adds `.gemini/settings.json`, and the final assertion verifies `mcpServers.rea`. `explicit-plan` demonstrates that explicit Antigravity scope avoids the extra write. The main sequence reproduced in two fresh isolated homes and again in the self-cleaning fixture above, for three successful reproductions. ### Expected behavior The documented broad scope should select clients with applicable client-specific configuration or installation-marker evidence. REA-created Antigravity configuration should not by itself identify Gemini CLI as present. The installation guide permits selecting a client before it has a detected configuration and defines `--all-detected` as configuring detected supported clients. Directory markers are supported evidence; executable-package verification is not required. The client guide explicitly distinguishes a product's own profile evidence from shared directories REA creates, using FreeBuff as the documented example. The detection helper's contract makes the same distinction between product applicability and shared registration ownership. The guides document Antigravity's nested destination and Gemini CLI's separate settings file, but do not document Antigravity setup opting Gemini CLI into automatic discovery. Source and documentation locators appear below. ### Impact and scope P2: the observed consequence is a repeatable extra client configuration write during broad setup, making its detected-client scope inaccurate. Explicit `--client antigravity --skill=false` provides a verified practical workaround: the subsequent explicit dry-run planned no changes and left Gemini settings absent. The broad write remains visible in the dry-run plan and requires the caller's approval. No data loss or security-boundary crossing was observed. Only REA's public CLI and filesystem effects on macOS were tested; actual Gemini CLI/Antigravity loading, Windows, and Linux remain untested. ### REA version Exact `node scripts/rea.mjs --version` output: ```text 6.8.0 ``` Source baseline: `65f1c447344a423fa2785847dbcea1e9a9e2454a`. ### Runtime and platform Node.js v24.22.1; macOS 27.0.1; Darwin arm64. No analysis provider or model session was used. ### Target and artifact context No analysis target. The fixture starts with an empty isolated home; its initial client configuration comes entirely from explicit Antigravity setup. ### Interface CLI ### Earliest failure stage Setup or provider admission ### Relevant output or evidence Reduced output from the executed fixture; file paths are relative to its isolated home: ```text empty: planned; detected=[]; planned=[]; files=[] antigravity: ready; applied=[configured_antigravity]; files=[.gemini/config/mcp_config.json] broad-plan: planned; detected=[gemini_cli, antigravity]; planned=[configure_client:gemini_cli] explicit-plan: planned; planned=[]; files=[.gemini/config/mcp_config.json] broad-apply: ready; applied=[configured_gemini_cli]; files=[.gemini/config/mcp_config.json, .gemini/settings.json] Gemini settings contains mcpServers.rea: True ``` Every CLI invocation exited 0. The broad dry-run left Gemini settings absent; the apply created them. Contract locators at the baseline: `docs/installation.md:40-44,120-125,138-148`; `docs/client-configuration.md:349-358,630-638`; `src/application/SupportedClients.ts:763-804`. Failure locators: Gemini CLI's parent-directory marker is defined in `src/application/SupportedClients.ts:556-565`, while Antigravity's nested write destination is defined at `:590-597`. Detection accepts an existing evidence path in `src/application/SetupHost.ts:485-517`. Broad selection consumes the detected IDs in `src/application/Setup.ts:153-161`. ### Typed outcome or recovery expected After Antigravity-only setup in this fixture, a broad dry-run should leave Gemini CLI outside automatic selection and propose no Gemini settings write. Explicitly selecting Gemini CLI should remain available. ### Analysis or suspected cause Source-derived explanation: creating `.gemini/config/mcp_config.json` also creates `.gemini`, which is Gemini CLI's detection marker. The discovery helper accepts the existence of that parent even when its only content belongs to Antigravity. The registration and detection paths therefore allow one client's configuration write to manufacture another client's applicability evidence. A correction should distinguish the two products' discovery evidence while preserving explicit configuration of a client before its marker exists. No particular replacement marker was tested. ### Additional context Related reports checked include [#7522](https://github.com/morluto/rea/issues/7522), concerning automatic selection of Grok Bot's manual hosted connector, and [#5443](https://github.com/morluto/rea/issues/5443)/[merged #5508](https://github.com/morluto/rea/pull/5508), concerning loss of an explicit client when combined with broad selection. Their triggers and required outcomes differ. [Open PR #5145](https://github.com/morluto/rea/pull/5145), head `e939e4547cb9e07a20d1f660f8ce3add4946f034`, replaces [closed #3249](https://github.com/morluto/rea/pull/3249) and separates Antigravity IDE/CLI evidence. Inspection of its detection changes shows overrides for those two surfaces only. Gemini CLI retains the `.gemini` marker, and the common helper still uses ordinary marker/config evidence when no override is supplied. Consequently the parent-directory collision described here remains under that proposed implementation. This is source analysis of the PR; its runtime was not executed. [Issue #3243](https://github.com/morluto/rea/issues/3243) and [merged PR #2736](https://github.com/morluto/rea/pull/2736) address the analogous shared-storage distinction for FreeBuff, using FreeBuff-specific discovery paths. They do not change Gemini CLI's marker. No existing report with this Antigravity-to-Gemini trigger and closure condition was found in the open/closed issue, PR, and comment searches. No last-known-good revision was established.
Author
Owner

@Tanmay9223 commented on GitHub (Nov 1, 2026):

I'd like to work on this! I will investigate tightening Gemini CLI's detection evidence in src/application/SupportedClients.ts so that broad setup (--all-detected) requires Gemini CLI's own configuration rather than matching the parent .gemini directory created by Antigravity setup, along with regression tests.

<!-- gh-comment-id:6556199773 --> @Tanmay9223 commented on GitHub (Nov 1, 2026): I'd like to work on this! I will investigate tightening Gemini CLI's detection evidence in `src/application/SupportedClients.ts` so that broad setup (`--all-detected`) requires Gemini CLI's own configuration rather than matching the parent `.gemini` directory created by Antigravity setup, along with regression tests.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4505
No description provided.