Skip to content

refactor(acp): migrate Gemini CLI to Antigravity CLI - #399

Open
muhamadgalihsaputra wants to merge 1 commit into
gnoviawan:devfrom
muhamadgalihsaputra:refactor/gemini-to-antigravity-cli
Open

refactor(acp): migrate Gemini CLI to Antigravity CLI#399
muhamadgalihsaputra wants to merge 1 commit into
gnoviawan:devfrom
muhamadgalihsaputra:refactor/gemini-to-antigravity-cli

Conversation

@muhamadgalihsaputra

@muhamadgalihsaputra muhamadgalihsaputra commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Renames Gemini CLI integrations to Antigravity CLI and changes binary target from 'gemini' to 'agy' across configs, templates, and registries, fixes asynchronous chat initialization loops in AgentLauncher, and updates associated ACP registry and launcher unit tests.

Summary by CodeRabbit

  • New Features

    • Added support for Antigravity CLI as an ACP agent option.
    • Updated the agent setup to use the native Antigravity command on supported platforms.
  • Bug Fixes

    • Improved agent launching reliability when configuration details change.
    • Better handling for agent packages so available installs and ready-to-run binaries are recognized correctly.
  • Tests

    • Updated automated coverage to reflect the new Antigravity agent name and behavior.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR renames the ACP agent from Gemini CLI to Antigravity CLI across registry data, templates, manifests, and tests. It also changes ACP binary config derivation and updates AgentLauncher’s prepare/cancel flow.

Changes

ACP agent rename and launcher flow

Layer / File(s) Summary
ACP identity and support entries
src/renderer/lib/agents/supported-acp-agents.ts, src/renderer/lib/agents/agent-registry.ts, src/renderer/components/chat/agent-templates.tsx, src/renderer/assets/agent-icons/acp/agents.json, src/renderer/assets/agent-icons/acp/manifest.json, src/renderer/lib/agents/agent-registry.test.ts, src/renderer/components/chat/agent-templates.test.ts, src/renderer/components/settings/AcpAgentsSettings.test.tsx, src/renderer/hooks/use-acp-agents.test.ts, src/renderer/lib/agents/acp-registry-catalog.test.ts, src/renderer/components/agents/AgentLauncher.test.tsx
gemini is replaced with antigravity across ACP support IDs, built-in agent metadata, template entries, asset data, and the matching tests.
Archive-aware ACP config derivation
src/renderer/lib/agents/acp-registry.ts, src/renderer/lib/agents/acp-registry.test.ts
Binary ACP config derivation now returns either a runnable config or a needs-install result with archiveUrl, and the tests cover both branches.
Launcher prepare and cancel flow
src/renderer/components/agents/AgentLauncher.tsx
AgentLauncher now reads the latest selected config and ACP configs through refs, derives a spawn key from command, args, and env, re-prepares chats when that key changes, and cancels prepared chats with the matching key.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • gnoviawan/termul#301: Updates the same ACP registry derivation path, including deriveAgentConfig and archive handling.
  • gnoviawan/termul#304: Touches AgentLauncher.tsx ACP session preparation and cleanup flow.
  • gnoviawan/termul#232: Introduces the built-in gemini-cli registry wiring and tests that this PR rewires to Antigravity CLI.

Poem

I thumped past Gemini under the moon,
then found Antigravity humming a tune.
agy hopped briskly, the configs fell in line,
and every little agent felt just fine.
🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: renaming the ACP Gemini CLI integration to Antigravity CLI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/renderer/components/chat/agent-templates.test.ts (1)

30-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the Antigravity launch config too.

These checks only pin the renamed label/icon, so the actual migration in agent-templates.tsx from the old invocation to agy --acp can regress unnoticed. Please assert templateById('antigravity')?.config.command and .args here as well.

Suggested test tightening
   it('templateById resolves a known template and returns undefined otherwise', () => {
-    expect(templateById('antigravity')?.label).toBe('Antigravity CLI')
+    const antigravity = templateById('antigravity')
+    expect(antigravity?.label).toBe('Antigravity CLI')
+    expect(antigravity?.config.command).toBe('agy')
+    expect(antigravity?.config.args).toEqual(['--acp'])
     expect(templateById('does-not-exist')).toBeUndefined()
   })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/components/chat/agent-templates.test.ts` around lines 30 - 36,
The agent template test only checks the renamed Antigravity label/icon, so it
can miss regressions in the launch config migration. In agent-templates.test.ts,
extend the templateById('antigravity') assertions to verify the returned
config.command and config.args from agent-templates.tsx, alongside the existing
label check, so the new agy --acp invocation is pinned by the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/renderer/assets/agent-icons/acp/manifest.json`:
- Around line 88-89: The Antigravity manifest entry is still pointing to the
Gemini asset, so update the manifest mapping for the antigravity entry to use
the correct Antigravity icon file instead of gemini.svg. Locate the entry by its
"id": "antigravity" and "name": "Antigravity CLI" in the manifest and change
only the referenced icon asset so this agent renders the right graphic.

In `@src/renderer/components/agents/AgentLauncher.tsx`:
- Around line 184-187: `configSpawnKey` in AgentLauncher is currently built from
a space-delimited string, which can collide for different spawn configs and miss
real changes. Update the `useMemo` that computes `configSpawnKey` to use an
unambiguous representation of `selectedConfig` by separating `command`, `args`,
and `env` with a structured serialization or delimiter-safe encoding, so the
effect reliably re-runs when any spawn config field changes.

In `@src/renderer/lib/agents/supported-acp-agents.ts`:
- Around line 9-13: The ACP agent ID rename in SUPPORTED_ACP_AGENT_IDS breaks
existing `acp-registry:gemini` selections because buildSupportedAcpAgents() and
useAcpAgents() only match the new config ID. Update the supported-agent
resolution path in supported-acp-agents.ts so the old `acp-registry:gemini`
value is treated as an alias or migrated to the new ID, and ensure
registryConfigId()/lastSelectedAgent restore logic can still match legacy
installs without falling back to a different agent.

---

Nitpick comments:
In `@src/renderer/components/chat/agent-templates.test.ts`:
- Around line 30-36: The agent template test only checks the renamed Antigravity
label/icon, so it can miss regressions in the launch config migration. In
agent-templates.test.ts, extend the templateById('antigravity') assertions to
verify the returned config.command and config.args from agent-templates.tsx,
alongside the existing label check, so the new agy --acp invocation is pinned by
the test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cbc5748-2587-4394-b5f6-961aabc8023f

📥 Commits

Reviewing files that changed from the base of the PR and between 83d3aac and 8180ae1.

📒 Files selected for processing (14)
  • src/renderer/assets/agent-icons/acp/agents.json
  • src/renderer/assets/agent-icons/acp/manifest.json
  • src/renderer/components/agents/AgentLauncher.test.tsx
  • src/renderer/components/agents/AgentLauncher.tsx
  • src/renderer/components/chat/agent-templates.test.ts
  • src/renderer/components/chat/agent-templates.tsx
  • src/renderer/components/settings/AcpAgentsSettings.test.tsx
  • src/renderer/hooks/use-acp-agents.test.ts
  • src/renderer/lib/agents/acp-registry-catalog.test.ts
  • src/renderer/lib/agents/acp-registry.test.ts
  • src/renderer/lib/agents/acp-registry.ts
  • src/renderer/lib/agents/agent-registry.test.ts
  • src/renderer/lib/agents/agent-registry.ts
  • src/renderer/lib/agents/supported-acp-agents.ts

Comment on lines +88 to +89
"id": "antigravity",
"name": "Antigravity CLI",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

manifest=$(fd -p manifest.json src/renderer/assets/agent-icons/acp)
agents=$(fd -p agents.json src/renderer/assets/agent-icons/acp)

echo "== Antigravity manifest entry =="
rg -n -C2 '"id": "antigravity"|"name": "Antigravity CLI"|"file":' "$manifest"

echo
echo "== Remaining Gemini/Antigravity references in ACP icon metadata =="
rg -n 'gemini|antigravity' "$manifest" "$agents"

echo
echo "== ACP icon files =="
fd . src/renderer/assets/agent-icons/acp

Repository: gnoviawan/termul

Length of output: 6016


Update the Antigravity manifest entry to use the correct icon
src/renderer/assets/agent-icons/acp/manifest.json still maps "id": "antigravity" / "name": "Antigravity CLI" to "file": "gemini.svg", so this entry renders the Gemini asset instead of an Antigravity-specific one.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/assets/agent-icons/acp/manifest.json` around lines 88 - 89, The
Antigravity manifest entry is still pointing to the Gemini asset, so update the
manifest mapping for the antigravity entry to use the correct Antigravity icon
file instead of gemini.svg. Locate the entry by its "id": "antigravity" and
"name": "Antigravity CLI" in the manifest and change only the referenced icon
asset so this agent renders the right graphic.

Comment on lines +184 to +187
const configSpawnKey = useMemo(() => {
if (!selectedConfig) return ''
return `${selectedConfig.command} ${selectedConfig.args.join(' ')} ${JSON.stringify(selectedConfig.env)}`
}, [selectedConfig])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make configSpawnKey unambiguous.

Line 186 flattens command, args, and env into a space-delimited string. Distinct spawn configs can collide (['--foo bar'] vs ['--foo', 'bar']), which means this effect can miss a real config change and skip the re-prepare it is trying to force.

Suggested change
  const configSpawnKey = useMemo(() => {
    if (!selectedConfig) return ''
-   return `${selectedConfig.command} ${selectedConfig.args.join(' ')} ${JSON.stringify(selectedConfig.env)}`
+   return JSON.stringify({
+     command: selectedConfig.command,
+     args: selectedConfig.args,
+     env: Object.entries(selectedConfig.env).sort(([a], [b]) => a.localeCompare(b))
+   })
  }, [selectedConfig])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const configSpawnKey = useMemo(() => {
if (!selectedConfig) return ''
return `${selectedConfig.command} ${selectedConfig.args.join(' ')} ${JSON.stringify(selectedConfig.env)}`
}, [selectedConfig])
const configSpawnKey = useMemo(() => {
if (!selectedConfig) return ''
return JSON.stringify({
command: selectedConfig.command,
args: selectedConfig.args,
env: Object.entries(selectedConfig.env).sort(([a], [b]) => a.localeCompare(b))
})
}, [selectedConfig])
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/components/agents/AgentLauncher.tsx` around lines 184 - 187,
`configSpawnKey` in AgentLauncher is currently built from a space-delimited
string, which can collide for different spawn configs and miss real changes.
Update the `useMemo` that computes `configSpawnKey` to use an unambiguous
representation of `selectedConfig` by separating `command`, `args`, and `env`
with a structured serialization or delimiter-safe encoding, so the effect
reliably re-runs when any spawn config field changes.

Comment on lines 9 to 13
export const SUPPORTED_ACP_AGENT_IDS = [
'codex-acp',
'claude-acp',
'gemini',
'antigravity',
'cursor',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Preserve legacy acp-registry:gemini data during this rename.

After Line 12 swaps the supported ID, buildSupportedAcpAgents() only looks up registryConfigId(id), and useAcpAgents() restores lastSelectedAgent by exact configId. Existing acp-registry:gemini installs/selections will stop matching after upgrade, so users silently fall back to another agent unless the old ID is aliased or migrated.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/lib/agents/supported-acp-agents.ts` around lines 9 - 13, The ACP
agent ID rename in SUPPORTED_ACP_AGENT_IDS breaks existing `acp-registry:gemini`
selections because buildSupportedAcpAgents() and useAcpAgents() only match the
new config ID. Update the supported-agent resolution path in
supported-acp-agents.ts so the old `acp-registry:gemini` value is treated as an
alias or migrated to the new ID, and ensure registryConfigId()/lastSelectedAgent
restore logic can still match legacy installs without falling back to a
different agent.

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.

2 participants