Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Named rows are smoked with `scripts/probe-harness.sh` (see [DEVELOPMENT.md](./do
| <img src="https://cdn.simpleicons.org/claude" width="14" alt="" /> `claude` | `npx -y @agentclientprotocol/claude-agent-acp@latest` | Zed's adapter over the Claude Agent SDK; no first-party ACP mode. Fresh and resumed sessions both work. |
| <img src="https://cdn.simpleicons.org/hermes" width="14" alt="" /> `hermes` | `hermes acp` | First-party. Fresh sessions work; a resume that cannot restore the session reopens (#448). |
| <img src="https://cdn.simpleicons.org/opencode" width="14" alt="" /> `opencode` | `opencode acp` | First-party. Fresh and resumed sessions both work. |
| `pi` | `npx -y pi-acp@latest` | Zed-registry adapter (`pi-acp`); no first-party ACP. Fresh and resumed sessions both work. Chat-only (no MCP). Footnote: requires a global `pi` on `PATH` — install with `brew install pi-coding-agent` (Homebrew pins Node in the shebang). `npx`/`node`/`pi` must resolve in the app's environment (Finder-launched builds inherit launchd's `PATH`, same as every other `npx` row). An unconfigured Pi may pick up an ambient provider key from the inherited environment; configuring `~/.pi/agent/` (e.g. `omlx launch pi`) wins over that fallback. npm-global `pi` can shadow the keg; `npm uninstall -g @earendil-works/pi-coding-agent` then `brew link pi-coding-agent`. Startup banner on the first fresh-session bubble is #597, not this row. |
| `grok` | `grok agent stdio` | First-party, Grok Build. `grok` alone is the interactive TUI, so the subcommand is the whole of the row. Fresh and resumed sessions both work. |
| anything else | as typed, split on whitespace | Unnamed, and it works: any command that speaks ACP on stdio attaches. <img src="https://cdn.simpleicons.org/githubcopilot" width="14" alt="" /> GitHub Copilot CLI (`copilot --acp --stdio`) reaches ai-buddy this way today and earns a named row once smoked (#457). Google has none: the Gemini CLI is sunset, and Antigravity speaks its own protocol rather than ACP (#603), so it needs an adapter (#604). |

Expand All @@ -164,10 +165,11 @@ How they handle session differs, and changes what ai-buddy can do with them:
| `claude` | yes | yes | yes | http | none advertised when signed in |
| `hermes` | yes | yes, after the reopen | yes | stdio | two: custom runtime credentials, Configure Hermes provider |
| `opencode` | yes | yes | yes | http | Login with opencode |
| `pi` | yes | yes | yes | none | `pi_terminal_login` |
| `grok` | yes | yes | yes | http | three: xai.api_key, cached_token, Grok |
| anything else | unverified | unverified | unverified | unverified | unverified |

- † What `initialize` advertised: `claude`, `opencode` and `grok` set `agentCapabilities.mcpCapabilities.http` (the running app hands the loopback URL); `hermes` omits it and gets the stdio binary that relays to the same endpoint (ADR-0023, ADR-0026). `opencode` and `grok` also advertise `sse`, which nothing here reads.
- † What `initialize` advertised: `claude`, `opencode` and `grok` set `agentCapabilities.mcpCapabilities.http` (the running app hands the loopback URL); `hermes` and `pi` omit it and get the stdio binary that relays to the same endpoint (ADR-0023, ADR-0026). `pi` advertises no HTTP MCP and gets nothing forwarded today. `opencode` and `grok` also advertise `sse`, which nothing here reads.
- ‡ `authMethods` is what is *available*, not what is outstanding — an empty list is no proof a login is unnecessary. Only `session/new` answering `-32000` is (ADR-0022).

### Harness ↔ MCP
Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Every variable that names a switch reads the same words: `1`, `on`, `true` or `y
| `AI_BUDDY_DIRECTOR` | The Director on or off, whatever Settings saved. Off keeps Static even when a key is set; on still needs a key or a local server. The window and the tray name the variable and disable the toggle. |
| `AI_BUDDY_DIRECTOR_TIMEOUT_SECS` | One turn's budget, whichever mind serves it: an HTTP Completer request or a Harness `session/prompt`. Expiry cancels the turn. Default 20 remote, 120 local — a cold local model loads weights on the first call. |
| `AI_BUDDY_DIRECTOR_MAX_TOKENS` | Reply cap for the HTTP Completer. Default 80 remote, 512 local. A Harness decides its own reply length. |
| `AI_BUDDY_HARNESS` | Attach a Harness as the Completer instead of the HTTP one: `claude`, `codex`, `grok`, `hermes`, `opencode`, or a command line that speaks ACP on stdio. The Harness signs in on its own; a not-signed-in one is named in the Chat surface with the command that fixes it. Set and empty is the kill switch — Off, whatever the AI tab's AI source row saved. Unset falls through to that row, which offers the same choices (Off, the presets, and Custom). ADR-0017, #436. |
| `AI_BUDDY_HARNESS` | Attach a Harness as the Completer instead of the HTTP one: `claude`, `codex`, `grok`, `hermes`, `opencode`, `pi`, or a command line that speaks ACP on stdio. The Harness signs in on its own; a not-signed-in one is named in the Chat surface with the command that fixes it. Set and empty is the kill switch — Off, whatever the AI tab's AI source row saved. Unset falls through to that row, which offers the same choices (Off, the presets, and Custom). ADR-0017, #436. |
| `AI_BUDDY_MCP_URL`, `AI_BUDDY_MCP_TOKEN` | Where the running app serves MCP on loopback, and the per-run bearer token that reaches it. The app sets both on the stdio MCP server entry it hands the Harness, and the shim relays there; with neither set it answers every call with a failure. Set them by hand to point the shim at an app you are already running. Never written to a file or a log. ADR-0026. |
| `AI_BUDDY_MCP_BIN` | Where the stdio MCP server binary is, when it is not beside the app. Overrides Settings → Development's "MCP server binary", and is read at attach, so a change lands on the next one. First of three stdio routes: this, else an `ai-buddy-mcp` sidecar beside the app, else the app binary itself (`--mcp-stdio`). All three relay to the running app over loopback, so a `speak` over them reaches the buddy once the app hands them the two variables above (#501). A Harness that advertises `mcpCapabilities.http` is handed the app's own loopback MCP server directly (ADR-0023). |
| `AI_BUDDY_HARNESS_AUTH_RETRY_SECS` | How long a Harness that has not signed in is left alone before `session/new` is tried again. Overrides Settings → Development's "Auth retry, in seconds", and 60 stands when neither says anything. Read when the Session is built, so a change lands on the next attach. |
Expand Down
2 changes: 1 addition & 1 deletion docs/research/buddy-harness-two-way.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ advertises an A2A server endpoint. Don't stretch it.
7. **Pi gets a second adapter, not a compromise.** Buddy → Pi is
`pi --mode rpc` with `{"type":"prompt",...}` and `streamingBehavior`; Pi →
Buddy is a Pi extension wrapping the same tool set, because Pi has no MCP.
Do not adopt the third-party `pi-acp` as the shipped path.
The shipped path is now the registry adapter; Buddy→Pi is `npx -y pi-acp@latest`; Pi→Buddy tools are still a Pi extension, not MCP. Point at #607.
8. **Treat Claude Code `channels` as an optional enhancement behind a flag**, if
ambient wake latency ever justifies it. It is the only way to push into a
session the user started themselves, and it is a research preview behind an
Expand Down
12 changes: 9 additions & 3 deletions src-tauri/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ pub struct Launch {
/// mode; `grok agent stdio`, `hermes acp` and `opencode acp` are
/// first-party. Anything else is a command line of the user's own, which is
/// how Copilot CLI attaches until it is smoked. Google has no row: the Gemini
/// CLI is sunset and Antigravity does not speak ACP (#603). Pi is deferred
/// (ADR-0022).
/// CLI is sunset and Antigravity does not speak ACP (#603). Pi is a named row
/// through Zed's registry adapter, same shape as `claude`. Copilot still
/// attaches via Custom until smoked.
///
/// The README's Harness Support table is this table's user-facing half and is
/// maintained by hand: a name or command changed here, or a new
Expand Down Expand Up @@ -131,6 +132,7 @@ pub fn launch(value: Option<&str>) -> Option<Launch> {
"grok" => (value, vec!["grok", "agent", "stdio"]),
"hermes" => (value, vec!["hermes", "acp"]),
"opencode" => (value, vec!["opencode", "acp"]),
"pi" => (value, vec!["npx", "-y", "pi-acp@latest"]),
custom => {
let argv: Vec<&str> = custom.split_whitespace().collect();
(argv[0], argv)
Expand Down Expand Up @@ -1940,6 +1942,10 @@ mod tests {
);
assert_eq!(launch(Some("hermes")).unwrap().argv, ["hermes", "acp"]);
assert_eq!(launch(Some("opencode")).unwrap().argv, ["opencode", "acp"]);
assert_eq!(
launch(Some("pi")).unwrap().argv,
["npx", "-y", "pi-acp@latest"]
);
let custom = launch(Some(" my-agent --acp --quiet ")).unwrap();
assert_eq!(custom.name, "my-agent");
assert_eq!(custom.argv, ["my-agent", "--acp", "--quiet"]);
Expand Down Expand Up @@ -2011,7 +2017,7 @@ mod tests {
/// it is, with no key set, no config dir moved, and no `--bare`.
#[test]
fn child_command_sets_no_env_and_passes_no_bare() {
for name in ["claude", "codex", "grok", "hermes", "opencode"] {
for name in ["claude", "codex", "grok", "hermes", "opencode", "pi"] {
let launch = launch(Some(name)).unwrap();
let command = launch.command(Path::new("/tmp"));
assert_eq!(command.get_envs().count(), 0, "{name} sets env");
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ fn permission_answer(request: String, option: String) {
#[tauri::command]
fn select_harness(harness: String, state: tauri::State<'_, SettingsState>) -> Result<(), String> {
// Validate that this is a known preset
if !["claude", "codex", "grok", "hermes", "opencode"].contains(&harness.as_str()) {
if !["claude", "codex", "grok", "hermes", "opencode", "pi"].contains(&harness.as_str()) {
return Err(format!("unknown Harness preset: {harness}"));
}

Expand All @@ -1249,6 +1249,7 @@ fn harness_login(harness: String) -> Result<(), String> {
"grok" => vec!["grok", "login"],
"hermes" => vec!["hermes", "login"],
"opencode" => vec!["opencode", "login"],
"pi" => vec!["npx", "-y", "pi-acp@latest", "--terminal-login"],
_ => return Err(format!("unknown Harness: {harness}")),
};

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ pub struct Settings {
pub director_wake_secs: String,
/// Which Harness is the Completer, in the values `AI_BUDDY_HARNESS` takes:
/// empty for none, a preset name (`claude`, `codex`, `grok`, `hermes`,
/// `opencode`), or `custom`, which defers to `harness_command`. The
/// `opencode`, `pi`), or `custom`, which defers to `harness_command`. The
/// variable outranks it, and either way `harness::retarget` reaches the
/// attachment now (#500).
pub harness: String,
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/settings/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ pub const HARNESS_CUSTOM_VALUE: &str = "custom";
/// The named launch rows, in ADR-0022's order. Copilot reaches the same
/// Completer through Custom until a turn has been smoked. Antigravity cannot:
/// it does not speak ACP, and wants an adapter first (#604).
pub const HARNESS_PRESETS: [&str; 5] = ["claude", "codex", "grok", "hermes", "opencode"];
pub const HARNESS_PRESETS: [&str; 6] = ["claude", "codex", "grok", "hermes", "opencode", "pi"];

/// The endpoints the Base URL picker names, as (group, name, base URL).
///
Expand Down Expand Up @@ -2066,7 +2066,7 @@ mod tests {
let (_, options, _) = popup_row(&description, HARNESS_ID);
assert_eq!(
options,
["Off", "claude", "codex", "grok", "hermes", "opencode", "Custom"]
["Off", "claude", "codex", "grok", "hermes", "opencode", "pi", "Custom"]
);
assert_eq!(
description.text_write(HARNESS_ID),
Expand Down
1 change: 1 addition & 0 deletions src/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ function attached(opening) {
grok: "Grok",
opencode: "OpenCode",
hermes: "Hermes",
pi: "Pi",
};
const harnessName = displayNames[opening.harness_name] || opening.harness_name || "The Harness";
title.textContent = `${harnessName} needs login`;
Expand Down