feat(agents): add Google Antigravity CLI as a built-in ACP agent (#7761)

Google Antigravity's CLI ships a native ACP server (`agy acp`, since v1.5.0), so it joins the built-in agents with `agy acp --login` as its sign-in command. A registry install of antigravity-acp runs a separate ACP server binary, so it keeps the generic sign-in hint instead of inheriting the CLI's login subcommand. Adds the Chinese text for the sign-in hint and the agent to the docs tables.

Co-authored-by: xirf <[email protected]>
Цей коміт міститься в:
Anka Tamaтаxirf authored and GitHub committed 2026-12-03 19:02:17 +08:00
1 джерело 6f7c8e246f
коміт 1dc1c67095
4 files changed
+103 -38

No files matched your search

+66 -4
Переглянути файл
@@ -91,6 +91,7 @@ const BUILTIN: &[(&str, &str, Driver, &[&str], &str)] = &[
("vibe", "Mistral Vibe", Driver::Acp, &["vibe-acp"], "Run `vibe` in a terminal and sign in."),
("omp", "OMP", Driver::Acp, &["omp", "acp"], "Run `omp` in a terminal and sign in."),
("hermes", "Hermes Agent", Driver::Acp, &["hermes", "acp"], "Run `hermes model` in a terminal."),
("antigravity-acp", "Google Antigravity", Driver::Acp, &["agy", "acp"], "Run `agy acp --login` in a terminal."),
];
fn builtins() -> Vec<ProviderSpec> {
@@ -230,7 +231,9 @@ impl ProviderSpec {
});
}
if let Some(builtin) = builtin_spec(&self.id) {
if let Some(builtin) = builtin_spec(&self.id)
&& !(matches!(self.source, AgentSource::Registry { .. }) && registry_uses_separate_binary(&self.id))
{
let args = terminal_auth_args
.filter(|_| matches!(self.source, AgentSource::Registry { .. }))
.map(<[String]>::to_vec)
@@ -597,6 +600,13 @@ pub(crate) fn is_unlisted(spec: &ProviderSpec) -> bool {
UNLISTED.contains(&spec.id.as_str()) && builtin_spec(&spec.id).as_ref() == Some(spec)
}
/// Built-in CLI agents whose ACP Registry archive ships a separate ACP server binary
/// rather than the CLI itself, so the built-in CLI's login subcommand does not apply
/// to a registry install.
fn registry_uses_separate_binary(id: &str) -> bool {
id == "antigravity-acp"
}
fn uses_package_runner(command: &str) -> bool {
matches!(command, "npx" | "bunx" | "uvx")
}
@@ -1064,7 +1074,9 @@ pub(crate) fn load(custom_dir: Option<&Path>, secrets: Option<&dyn EnvSecrets>)
};
match specs.iter_mut().find(|s| s.id == spec.id) {
Some(existing) => {
spec.login_hint = existing.login_hint.clone();
if !(matches!(spec.source, AgentSource::Registry { .. }) && registry_uses_separate_binary(&spec.id)) {
spec.login_hint = existing.login_hint.clone();
}
if !explicit_driver && existing.driver == Driver::Copilot && spec.driver == Driver::Acp {
// Registry installs (`github-copilot-cli`) record `args = ["--acp"]` with no
// `driver`; upgrade them in place to the native headless driver (which
@@ -1133,6 +1145,55 @@ mod tests {
assert_eq!(info.login_hint.as_deref(), Some("Run `hermes model` in a terminal."));
}
#[test]
fn antigravity_is_built_in_over_acp() {
let spec = builtin_spec("antigravity-acp").unwrap();
assert_eq!(spec.driver, Driver::Acp);
assert!(!is_builtin("antigravity-acp"));
let info = describe(&spec);
assert_eq!((info.name.as_str(), info.command.as_str()), ("Google Antigravity", "agy acp"));
assert_eq!(info.login_hint.as_deref(), Some("Run `agy acp --login` in a terminal."));
assert!(info.command_editable);
assert_eq!(info.additional_args, Some(vec![]));
}
#[test]
fn registry_antigravity_does_not_inherit_cli_login_subcommand() {
let dir = tempfile::tempdir().unwrap();
let bin = dir.path().join(if cfg!(windows) { "agy_acp_server.exe" } else { "agy_acp_server.par" });
std::fs::write(&bin, "#!/bin/sh\n").unwrap();
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
std::fs::set_permissions(&bin, std::fs::Permissions::from_mode(0o755)).unwrap();
}
CustomAgent {
name: Some("Google Antigravity".into()),
driver: Driver::Acp,
command: bin.to_string_lossy().into_owned(),
args: Vec::new(),
additional_args: Vec::new(),
env: BTreeMap::new(),
registry: Some(RegistryRef { id: "antigravity-acp".into(), version: "1.5.2".into() }),
}
.write(&dir.path().join("antigravity-acp.toml"))
.unwrap();
let reg = load(Some(dir.path()), None).into_iter().find(|s| s.id == "antigravity-acp").unwrap();
assert_eq!(reg.source, AgentSource::Registry { version: "1.5.2".into(), update: None });
assert_eq!(reg.login_hint, "Sign in with the agent's own command line first.");
assert_eq!(describe(&reg).login_hint.as_deref(), Some("Sign in with the agent's own command line first."));
assert!(reg.login_launch(dir.path(), None).is_none());
let terminal_launch = reg.login_launch(dir.path(), Some(&["--login".into()])).unwrap();
assert_eq!(terminal_launch.program, bin);
assert_eq!(terminal_launch.args, ["--login"]);
std::fs::remove_file(dir.path().join("antigravity-acp.toml")).unwrap();
let builtin = load(Some(dir.path()), None).into_iter().find(|s| s.id == "antigravity-acp").unwrap();
assert_eq!(builtin.source, AgentSource::Builtin);
assert_eq!((builtin.command.as_str(), builtin.args.as_slice()), ("agy", &["acp".to_owned()][..]));
}
#[test]
fn qoder_global_and_cn_editions_are_both_built_in() {
let info = |id: &str| describe(&load(None, None).into_iter().find(|s| s.id == id).unwrap());
@@ -1185,6 +1246,7 @@ mod tests {
assert_eq!(args("copilot"), ["login"]);
assert_eq!(args("goose"), ["configure"]);
assert_eq!(args("hermes"), ["model"]);
assert_eq!(args("antigravity-acp"), ["acp", "--login"]);
assert!(args("qwen").is_empty());
}
@@ -1311,10 +1373,10 @@ mod tests {
for p in &defaults {
assert_eq!(p.source, AgentSource::Builtin);
assert!(p.default_program.is_some());
assert_eq!(p.command_editable, !p.id.ends_with("-acp"));
assert_eq!(p.command_editable, !uses_package_runner(&p.program));
assert_eq!(
p.command_read_only_reason,
p.id.ends_with("-acp").then_some(AgentCommandReadOnlyReason::PackageRunner)
uses_package_runner(&p.program).then_some(AgentCommandReadOnlyReason::PackageRunner)
);
}
set_builtin_command(dir.path(), None, "codex", Some("/path with spaces/codex")).unwrap();
+18 -17
Переглянути файл
@@ -11,23 +11,24 @@ OpenIDEA does not include a model or an account of its own: it starts the agent
These agents are built in. Use **Install CLI** in [Agent Setup](#manage-agents) where available, or install the agent's CLI and make it available on `PATH`. Sign in from Agent Setup or a terminal on the project host.
| Agent | Command OpenIDEA starts | Sign in with |
| -------------- | --------------------------- | --------------------- |
| Claude Code | `claude` | `claude` |
| Codex | `codex app-server` | `codex login` |
| Gemini CLI | `gemini --experimental-acp` | `gemini` |
| GitHub Copilot | `copilot --acp` | `copilot login` |
| Cursor | `cursor-agent acp` | `cursor-agent login` |
| OpenCode | `opencode acp` | `opencode auth login` |
| Qwen Code | `qwen --experimental-acp` | `qwen` |
| Qoder | `qodercli --acp` | `qodercli login` |
| Qoder CN | `qoderclicn --acp` | `qoderclicn login` |
| Kimi CLI | `kimi acp` | `kimi` |
| Goose | `goose acp` | `goose configure` |
| Auggie | `auggie --acp` | `auggie login` |
| Kiro | `kiro-cli acp` | `kiro-cli login` |
| Mistral Vibe | `vibe-acp` | `vibe` |
| Hermes Agent | `hermes acp` | `hermes model` |
| Agent | Command OpenIDEA starts | Sign in with |
| ------------------ | --------------------------- | --------------------- |
| Claude Code | `claude` | `claude` |
| Codex | `codex app-server` | `codex login` |
| Gemini CLI | `gemini --experimental-acp` | `gemini` |
| GitHub Copilot | `copilot --acp` | `copilot login` |
| Cursor | `cursor-agent acp` | `cursor-agent login` |
| OpenCode | `opencode acp` | `opencode auth login` |
| Qwen Code | `qwen --experimental-acp` | `qwen` |
| Qoder | `qodercli --acp` | `qodercli login` |
| Qoder CN | `qoderclicn --acp` | `qoderclicn login` |
| Kimi CLI | `kimi acp` | `kimi` |
| Goose | `goose acp` | `goose configure` |
| Auggie | `auggie --acp` | `auggie login` |
| Kiro | `kiro-cli acp` | `kiro-cli login` |
| Mistral Vibe | `vibe-acp` | `vibe` |
| Hermes Agent | `hermes acp` | `hermes model` |
| Google Antigravity | `agy acp` | `agy acp --login` |
**Claude Code** and **Codex** are driven through their own protocols (Claude Code's stream-json mode and `codex app-server`). Their ACP adapters (`claude-acp`, `codex-acp`) are no longer listed; tasks that already use them keep working, and an [agent file](#add-a-custom-agent) for either id lists it again. If an agent needs you to sign in, the task tells you which command to run.
+18 -17
Переглянути файл
@@ -11,23 +11,24 @@ OpenIDEA 本身不带模型或账号:它启动你已安装并登录的 agent
以下 agent 是内置的。可以在智能体配置中使用**安装 CLI**,也可以自行安装命令行工具并将其加入 `PATH`。然后在智能体配置中或项目主机的终端里登录。
| Agent | OpenIDEA 启动的命令 | 登录命令 |
| -------------- | --------------------------- | --------------------- |
| Claude Code | `claude` | `claude` |
| Codex | `codex app-server` | `codex login` |
| Gemini CLI | `gemini --experimental-acp` | `gemini` |
| GitHub Copilot | `copilot --acp` | `copilot login` |
| Cursor | `cursor-agent acp` | `cursor-agent login` |
| OpenCode | `opencode acp` | `opencode auth login` |
| Qwen Code | `qwen --experimental-acp` | `qwen` |
| Qoder | `qodercli --acp` | `qodercli login` |
| Qoder CN | `qoderclicn --acp` | `qoderclicn login` |
| Kimi CLI | `kimi acp` | `kimi` |
| Goose | `goose acp` | `goose configure` |
| Auggie | `auggie --acp` | `auggie login` |
| Kiro | `kiro-cli acp` | `kiro-cli login` |
| Mistral Vibe | `vibe-acp` | `vibe` |
| Hermes Agent | `hermes acp` | `hermes model` |
| Agent | OpenIDEA 启动的命令 | 登录命令 |
| ------------------ | --------------------------- | --------------------- |
| Claude Code | `claude` | `claude` |
| Codex | `codex app-server` | `codex login` |
| Gemini CLI | `gemini --experimental-acp` | `gemini` |
| GitHub Copilot | `copilot --acp` | `copilot login` |
| Cursor | `cursor-agent acp` | `cursor-agent login` |
| OpenCode | `opencode acp` | `opencode auth login` |
| Qwen Code | `qwen --experimental-acp` | `qwen` |
| Qoder | `qodercli --acp` | `qodercli login` |
| Qoder CN | `qoderclicn --acp` | `qoderclicn login` |
| Kimi CLI | `kimi acp` | `kimi` |
| Goose | `goose acp` | `goose configure` |
| Auggie | `auggie --acp` | `auggie login` |
| Kiro | `kiro-cli acp` | `kiro-cli login` |
| Mistral Vibe | `vibe-acp` | `vibe` |
| Hermes Agent | `hermes acp` | `hermes model` |
| Google Antigravity | `agy acp` | `agy acp --login` |
**Claude Code** 和 **Codex** 通过它们自己的协议驱动(Claude Code 的 stream-json 模式和 `codex app-server`)。它们的 ACP 适配器(`claude-acp`、`codex-acp`)不再列出;已经在用它们的任务照常运行,为这两个 id 写一个 [agent 文件](#添加自定义-agent)也会重新列出。agent 需要登录时,任务中会提示该运行哪条命令。
+1
Переглянути файл
@@ -1087,6 +1087,7 @@
"Reports newer crate versions that Cargo.toml requirements do not already allow.": "报告 Cargo.toml 版本要求尚未允许的较新 crate 版本。",
"Serializable class without 'serialVersionUID'": "没有 'serialVersionUID' 的可序列化类",
"Reports classes that implement Serializable but declare no serialVersionUID field. Alt+Enter on the class name adds a default or a generated ID. The Java language server checks it, and restarts when this is changed.": "报告实现了 Serializable 但没有声明 serialVersionUID 字段的类。在类名上按 Alt+Enter 可添加默认 ID 或生成的 ID。此检查由 Java 语言服务器执行,更改后语言服务器会重启。",
"Run `agy acp --login` in a terminal.": "在终端中运行 `agy acp --login`。",
"Run `auggie login` in a terminal.": "在终端中运行 `auggie login`。",
"Run `claude` in a terminal and sign in.": "在终端中运行 `claude` 并登录。",
"Run `codex login` in a terminal.": "在终端中运行 `codex login`。",