diff --git a/README.md b/README.md index 7fa1980..8728017 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Claudiu is a native desktop app, written in Rust with [Rune](https://github.com/ ## What it does -Each session is your own `claude` process in a real terminal, and sign-in stays with Claude Code. Around it, Claudiu adds a sidebar of running and recent sessions, notifications when a background session finishes or asks something, an editor mode (Ctrl+Shift+E), usage meters, a GitHub pane, cards Claude draws inline, sessions that move between git worktrees, extra accounts that share one configuration, and Codex, OpenCode and Google Antigravity subagents (Settings โ†’ Custom subagents). Codex subagents need Node and a `codex login`, OpenCode subagents need `opencode` on PATH, Antigravity subagents need the Antigravity CLI (`agy`) installed and signed in, and with Allow edits on, each acts without Claude Code's permission rules. Read-only Antigravity runs from its own folder in Claudiu's data, whose hook refuses every tool but reading and searching, so your own Antigravity rules, skills and MCP servers don't load there. With Codex subagents on, the sidebar also shows Codex's 5-hour and 7-day limits, which Claudiu reads from the session logs in `~/.codex`; with Antigravity subagents on, it shows Antigravity's limits for each group of models, from `agy`'s own `/usage`, asked every five minutes at no token cost. Their last saved readings show at launch and refresh in the background. Settings lists the rest. +Each session is your own `claude` process in a real terminal, and sign-in stays with Claude Code. Around it, Claudiu adds a sidebar of running and recent sessions, notifications when a background session finishes or asks something, an editor mode (Ctrl+Shift+E), usage meters, a GitHub pane, cards Claude draws inline, sessions that move between git worktrees, extra accounts that share one configuration, and Codex, OpenCode and Google Antigravity subagents (Settings โ†’ Custom subagents). Codex subagents need Node and a `codex login`, OpenCode subagents need `opencode` on PATH, Antigravity subagents need the Antigravity CLI (`agy`) installed and signed in, and with Allow edits on, each acts without Claude Code's permission rules. Read-only Antigravity runs from its own folder in Claudiu's data, whose hook refuses every tool but reading and searching, so your own Antigravity rules, skills and MCP servers don't load there. Google's [Antigravity terms](https://antigravity.google/terms) and [FAQ](https://antigravity.google/docs/faq) forbid using another company's agent, such as Claude Code, with a personal Google sign-in. That covers the Free, AI Plus, Pro and Ultra plans. Google can suspend or terminate the Antigravity and Gemini CLI accounts of anyone who does, so turn Antigravity subagents on at your own risk. With Codex subagents on, the sidebar also shows Codex's 5-hour and 7-day limits, which Claudiu reads from the session logs in `~/.codex`; with Antigravity subagents on, it shows Antigravity's limits for each group of models, from `agy`'s own `/usage`, asked every five minutes at no token cost. Their last saved readings show at launch and refresh in the background. Settings lists the rest. While a custom subagent works, its own view in Claude Code's tasks list streams its messages, reasoning, plan and tool steps and command output. The main conversation stays as it is until the subagent hands back its report. The first Codex run takes longer while npm downloads the adapter. Claude can choose a Codex subagent's effort when it starts one (`max` runs as Codex's `xhigh`); otherwise Codex uses the effort in `~/.codex/config.toml`. diff --git a/src/app/headless.rs b/src/app/headless.rs index 33bfb1b..3e4b703 100644 --- a/src/app/headless.rs +++ b/src/app/headless.rs @@ -2623,6 +2623,30 @@ fn a_long_model_name_keeps_the_switch_in_its_row() { assert!(done[1] + done[3] <= dialog[1] + dialog[3], "Done stays in the dialog: {done:?}"); } +/// Google's terms for Antigravity forbid another company's agent driving it on a personal sign-in, so its card and its +/// dialog warn of suspension before it is switched on: the card's switch can turn it on without the dialog. The other +/// agents have no such warning. +#[test] +fn antigravity_warns_of_suspension() { + let warns = |h: &Harness| h.rt.elements().into_iter().filter_map(|e| e.text).filter(|t| t.contains("Google can suspend or terminate the Antigravity and Gemini CLI accounts")).count(); + let mut h = Harness::new(|_| vec![]); + h.step(|ws| { + ws.model_lookups.list = |_, _| Ok(vec![]); + ws.act(Act::OpenSettings); + ws.set_settings_page(SettingsPage::CustomSubagents); + }); + h.settle(); + assert!(h.drawn("settings-antigravity-warning") && warns(&h) == 1, "Antigravity's card warns while still off"); + assert!(!h.drawn("settings-codex-warning") && !h.drawn("settings-opencode-warning"), "the other cards don't"); + h.click("settings-antigravity-open"); + h.settle(); + assert!(h.drawn("agent-dialog-antigravity-warning") && warns(&h) == 2, "Antigravity's dialog warns too"); + h.click("agent-dialog-done"); + h.click("settings-codex-open"); + h.settle(); + assert!(h.drawn("agent-dialog") && !h.drawn("agent-dialog-codex-warning"), "Codex's dialog has no warning"); +} + /// Settings โ†’ Custom subagents: each agent is a card with a switch. Switching one on with no model opens its dialog, /// which lists the models the agent offers, with a search, and holds Allow edits; the card sums up what Claude gets. /// Save keeps the models switched on, and a new session hands the mod one agent type for each. diff --git a/src/claude/subagents.rs b/src/claude/subagents.rs index f02be1f..96b35da 100644 --- a/src/claude/subagents.rs +++ b/src/claude/subagents.rs @@ -70,6 +70,8 @@ pub struct Provider { pub about: &'static str, pub edits_on: &'static str, pub edits_off: &'static str, + /// A risk the settings page shows before the agent is switched on, such as a sign-in its maker's terms forbid here. + pub warning: Option<&'static str>, /// Arguments after `args` for one task's server, made ready here. pub task_args: fn(&super::acp::Request) -> Result, String>, /// The environment the server starts with, for agents that take the model, effort and edits that way. @@ -111,6 +113,7 @@ const CODEX: Provider = Provider { about: "Runs the task in OpenAI Codex through codex-acp. Needs Node (npx) and a `codex login`; the first run downloads codex-acp from npm.", edits_on: "Claudiu accepts everything Codex asks for: editing files, running commands, writing outside the folder and using the network. None of it goes through Claude Code's permission rules or hooks.", edits_off: "Codex runs read-only: it can read and search, but not change files.", + warning: None, task_args: super::acp::no_args, environment: super::acp::codex_env, config_options: super::acp::no_options, @@ -138,6 +141,7 @@ const OPENCODE: Provider = Provider { about: "Runs the task in OpenCode (`opencode acp`), on the providers you set up in OpenCode. Needs `opencode` on PATH.", edits_on: "Claudiu accepts everything OpenCode asks for, and OpenCode's own permission settings decide the rest: it can edit files, run commands and use the network. None of it goes through Claude Code's permission rules or hooks.", edits_off: "OpenCode runs read-only: it can read, search and list files, but not change them or run any command, not even a read-only one.", + warning: None, task_args: super::acp::no_args, environment: super::acp::opencode_env, config_options: super::acp::no_options, @@ -168,6 +172,9 @@ const ANTIGRAVITY: Provider = Provider { about: "Runs the task in Google Antigravity (`agy acp`), on the Gemini, Claude and GPT models your Google plan includes. Needs the Antigravity CLI, signed in through `agy`.", edits_on: "Claudiu puts Antigravity in accept-edits mode and allows everything it asks for: editing files and running commands. None of it goes through Claude Code's permission rules or hooks.", edits_off: "Antigravity runs read-only: it can read and search, but not change files or run commands. It runs from its own folder in Claudiu's data, so your Antigravity rules, skills and MCP servers don't load.", + // Google's FAQ names Claude Code among the third-party software barred from Antigravity logins, under Section 6 of + // the Antigravity Additional Terms (https://antigravity.google/docs/faq, https://antigravity.google/terms). + warning: Some("Google's Antigravity terms forbid using another company's agent, such as Claude Code, with a personal Google sign-in. That covers the Free, AI Plus, Pro and Ultra plans. Google can suspend or terminate the Antigravity and Gemini CLI accounts of anyone who does. Switch this on at your own risk."), task_args: super::acp::antigravity_args, environment: super::acp::no_env, config_options: super::acp::antigravity_options, diff --git a/src/panels/settings_view.rs b/src/panels/settings_view.rs index dc12f27..0a6f680 100644 --- a/src/panels/settings_view.rs +++ b/src/panels/settings_view.rs @@ -107,6 +107,10 @@ fn agent_card(agent: Agent, form: &AgentForm, catalog: &[AgentModel], lookup: &L let names: Vec<&str> = form.models.iter().map(|id| catalog.iter().find(|m| &m.id == id).map_or(id.as_str(), |m| m.name.as_str())).collect(); about = about.child(label(names.join(" ยท "), 11.0, theme::TEXT_FAINT).truncate()); } + // The card's switch turns an agent on without opening its dialog once models are saved, so the card warns too. + if let Some(warning) = agent.provider().warning { + about = about.child(label(warning, 11.0, theme::WARN).wrap().key(format!("settings-{key}-warning"))); + } let open = row() .key(format!("settings-{key}-open")) .grow(1.0) @@ -255,7 +259,11 @@ impl Workspace { .gap(8.0) .w_full() .child(rune::text(format!("{} subagents", provider.name)).font(font(15.0, 600.0)).color(rgb(theme::TEXT))) - .child(faint(provider.about)) + .child(faint(provider.about)); + if let Some(warning) = provider.warning { + top = top.child(label(warning, 11.0, theme::WARN).wrap().key(format!("agent-dialog-{key}-warning"))); + } + top = top .child(switch_row(format!("agent-dialog-{key}-on"), &format!("Give Claude {} subagents", provider.name), None, form.on, move |ws| flip_agent(ws, agent))); let mut models = col().key("agent-dialog-models").w_full().gap(8.0); if form.on {