refactor(acp): migrate Gemini CLI to Antigravity CLI - #399
refactor(acp): migrate Gemini CLI to Antigravity CLI#399muhamadgalihsaputra wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe 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. ChangesACP agent rename and launcher flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/renderer/components/chat/agent-templates.test.ts (1)
30-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the Antigravity launch config too.
These checks only pin the renamed label/icon, so the actual migration in
agent-templates.tsxfrom the old invocation toagy --acpcan regress unnoticed. Please asserttemplateById('antigravity')?.config.commandand.argshere 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
📒 Files selected for processing (14)
src/renderer/assets/agent-icons/acp/agents.jsonsrc/renderer/assets/agent-icons/acp/manifest.jsonsrc/renderer/components/agents/AgentLauncher.test.tsxsrc/renderer/components/agents/AgentLauncher.tsxsrc/renderer/components/chat/agent-templates.test.tssrc/renderer/components/chat/agent-templates.tsxsrc/renderer/components/settings/AcpAgentsSettings.test.tsxsrc/renderer/hooks/use-acp-agents.test.tssrc/renderer/lib/agents/acp-registry-catalog.test.tssrc/renderer/lib/agents/acp-registry.test.tssrc/renderer/lib/agents/acp-registry.tssrc/renderer/lib/agents/agent-registry.test.tssrc/renderer/lib/agents/agent-registry.tssrc/renderer/lib/agents/supported-acp-agents.ts
| "id": "antigravity", | ||
| "name": "Antigravity CLI", |
There was a problem hiding this comment.
🎯 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/acpRepository: 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.
| const configSpawnKey = useMemo(() => { | ||
| if (!selectedConfig) return '' | ||
| return `${selectedConfig.command} ${selectedConfig.args.join(' ')} ${JSON.stringify(selectedConfig.env)}` | ||
| }, [selectedConfig]) |
There was a problem hiding this comment.
🎯 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.
| 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.
| export const SUPPORTED_ACP_AGENT_IDS = [ | ||
| 'codex-acp', | ||
| 'claude-acp', | ||
| 'gemini', | ||
| 'antigravity', | ||
| 'cursor', |
There was a problem hiding this comment.
🗄️ 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.
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
Bug Fixes
Tests