-
Notifications
You must be signed in to change notification settings - Fork 39
refactor(acp): migrate Gemini CLI to Antigravity CLI #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -175,34 +175,48 @@ export function AgentLauncher({ paneId, className }: AgentLauncherProps): React. | |||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }, [persistSelection, selectedConfigId, supportedAgents]) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const selectedConfigRef = useRef(selectedConfig) | ||||||||||||||||||||||||||
| selectedConfigRef.current = selectedConfig | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const acpConfigsRef = useRef(acpConfigs) | ||||||||||||||||||||||||||
| acpConfigsRef.current = acpConfigs | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const configSpawnKey = useMemo(() => { | ||||||||||||||||||||||||||
| if (!selectedConfig) return '' | ||||||||||||||||||||||||||
| return `${selectedConfig.command} ${selectedConfig.args.join(' ')} ${JSON.stringify(selectedConfig.env)}` | ||||||||||||||||||||||||||
| }, [selectedConfig]) | ||||||||||||||||||||||||||
|
Comment on lines
+184
to
+187
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Make Line 186 flattens 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||||||
| if (!activeConfigId || !projectRoot || selectedEntry?.status !== 'ready' || !selectedConfig) | ||||||||||||||||||||||||||
| if ( | ||||||||||||||||||||||||||
| !activeConfigId || | ||||||||||||||||||||||||||
| !projectRoot || | ||||||||||||||||||||||||||
| selectedEntry?.status !== 'ready' || | ||||||||||||||||||||||||||
| !selectedConfigRef.current | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||
| let cancelled = false | ||||||||||||||||||||||||||
| void (async () => { | ||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||
| if (!acpConfigs.some((config) => config.id === selectedConfig.id)) { | ||||||||||||||||||||||||||
| await saveAgentConfig(selectedConfig) | ||||||||||||||||||||||||||
| const currentConfig = selectedConfigRef.current | ||||||||||||||||||||||||||
| if (!currentConfig) return | ||||||||||||||||||||||||||
| const currentConfigs = acpConfigsRef.current | ||||||||||||||||||||||||||
| if (!currentConfigs.some((config) => config.id === currentConfig.id)) { | ||||||||||||||||||||||||||
| await saveAgentConfig(currentConfig) | ||||||||||||||||||||||||||
| if (cancelled) return | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| useAcpStore.getState().prepareChat(activeConfigId, projectRoot) | ||||||||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||||||||
| console.warn('[acp] failed to prepare supported agent', activeConfigId, err) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| })() | ||||||||||||||||||||||||||
| // Re-prepare when command/args/env change | ||||||||||||||||||||||||||
| void configSpawnKey | ||||||||||||||||||||||||||
| const key = prepareChatKey(activeConfigId, projectRoot, undefined) | ||||||||||||||||||||||||||
| return () => { | ||||||||||||||||||||||||||
| cancelled = true | ||||||||||||||||||||||||||
| useAcpStore.getState().cancelPreparedChat(key) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| }, [ | ||||||||||||||||||||||||||
| activeConfigId, | ||||||||||||||||||||||||||
| acpConfigs, | ||||||||||||||||||||||||||
| projectRoot, | ||||||||||||||||||||||||||
| saveAgentConfig, | ||||||||||||||||||||||||||
| selectedConfig, | ||||||||||||||||||||||||||
| selectedEntry?.status | ||||||||||||||||||||||||||
| ]) | ||||||||||||||||||||||||||
| }, [activeConfigId, projectRoot, saveAgentConfig, selectedEntry?.status, configSpawnKey]) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| const handleSelectAgent = useCallback( | ||||||||||||||||||||||||||
| (entry: SupportedAcpAgentEntry) => { | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ import { | |
| export const SUPPORTED_ACP_AGENT_IDS = [ | ||
| 'codex-acp', | ||
| 'claude-acp', | ||
| 'gemini', | ||
| 'antigravity', | ||
| 'cursor', | ||
|
Comment on lines
9
to
13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Preserve legacy After Line 12 swaps the supported ID, 🤖 Prompt for AI Agents |
||
| 'opencode', | ||
| 'pi-acp' | ||
|
|
||
There was a problem hiding this comment.
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:
Repository: gnoviawan/termul
Length of output: 6016
Update the Antigravity manifest entry to use the correct icon
src/renderer/assets/agent-icons/acp/manifest.jsonstill 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