Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
6.7 KiB
created, status, referenced_runbook
| created | status | referenced_runbook |
|---|---|---|
| 2026-09-03 | in-progress | docs/public/add-agent-cli.md |
Implementation Plan: Goose (AAIF) ACP Agent Support
Overview
Add the Goose open-source coding agent (Agentic AI Foundation / AAIF, formerly
Block; repo aaif-goose/goose) as a first-class Kandev agent. Users can select
Goose as their coding agent; Kandev detects it, launches it over ACP, wires
permissions and MCP through session/new, supports one-shot inference, CLI
passthrough, and session resume.
Goose speaks ACP over stdio via goose acp, the exact protocol Kandev's
agentctl adapter factory accepts. It is distributed as a native CLI binary
(install script download_cli.sh, Homebrew block-goose-cli, or pip install goose-ai), so it is discovered purely on PATH and uses no managed
npm runtime. Config lives under ~/.config/goose; session/history data under
~/.local/share/goose. Credentials come from goose configure.
Because Goose is a native-binary ACP agent, this is the runbook's "Ship a
structured ACP integration" path (docs/public/add-agent-cli.md), modeled on
agents/gemini.go (example) and agents/agent.go (contract); Hermes, Qwen,
and Devin are the closest siblings.
Verified integration contract
Evidence is drawn from the Goose source, an ACP client reference
(catatafishen/agentbridge#1009, merged), terminal-transcript detection
(herdrdev/herdr#3279), and Paseo's per-agent catalog for positioning.
- Launch:
["goose", "acp"]; passthrough["goose"]. - Protocol:
agent.ProtocolACP(only protocol the adapter factory accepts). - MCP: delivered natively via ACP
session/new(mcpServers); noProjectMCPStrategyneeded. Goose supports Stdio and HTTP (StreamableHttp) MCP but rejects SSE; keepAssumeMcpSse=false. - Developer built-in:
goose acpauto-enables Goose'sdeveloperbuilt-in extension by default; this is expected and documented. - Global extensions: Goose loads globally-enabled extensions even when
session/newMCP servers are passed; there is no skip knob ongoose acp. Accepted behavior; a slow unrelated global extension may delayinitialize. - Session resume: ACP
session/load; native resume enabled with session root{home}/.local/share/goose. - Auth: declarative config (
~/.config/goose); primary remote path is afilesRemoteAuthcopy of the config dir; optionalgoose configurePTY login. - Permissions: Goose presents real interactive approval prompts; map
PermissionKeyAutoApproveviaPermissionApplyMethodAgentctlAutoApprove. - Environment: no required environment variables; Goose reads provider credentials from its config files.
- Install script: Kandev downloads the official script to a temporary file,
runs it with
CONFIGURE=falsein the first writable absolute directory on the currentPATH, and verifies the installedgoose acp --helpcommand.
Deviation from earlier plan draft:
NativeBinaryAgentis not implemented. The interface (agent.go) is specifically for npm-distributed packages that also ship a standalone CLI (e.g. Copilot) to prefer overnpx. Goose is a pure native binary with no npm launch path, so the interface does not apply; implementing it would be a meaningless flag.
Files
Create
apps/backend/internal/agent/agents/goose_acp.goapps/backend/internal/agent/agents/goose_acp_test.goapps/backend/internal/agent/agents/logos/goose_light.svgapps/backend/internal/agent/agents/logos/goose_dark.svgdocs/plans/goose-agent/plan.md(this document; shipped in the PR as a reference for reviewers and future contributors)
Modify
apps/backend/internal/agent/registry/registry.go— addagents.NewGooseACP()toLoadDefaults()afterNewHermesACP().apps/backend/internal/agent/agents/new_acp_agents_test.go— add aGooseACPentry tonewACPAgentSpecsso the shared contract matrix, detection, logos, and display-order tests cover it.
Docs
docs/public/agents-and-profiles.md— document Goose as a supported agent (install, launch viagoose acp, credentials viagoose configure) at parity with peers.
Steps
- Contract pinning (TDD) — write
goose_acp_test.gofirst, pinning: identity (goose-acp, "Goose ACP Agent", "Goose", DisplayOrder 22);["goose","acp"]across BuildCommand/Runtime.Cmd/InferenceConfig.Command; passthrough["goose"];Runtime().Protocol == agent.ProtocolACP;SessionDirTemplate == "{home}/.local/share/goose"; InstallScript; RemoteAuth files for darwin/linux; no provider environment requirements; logos non-empty; bounded ACP-help detection. - Implement
goose_acp.go—type GooseACP struct { StandardPassthrough }; marker interfacesAgent,PassthroughAgent,InferenceAgent,LoginAgent;goosebinary viaCmd/Commandbuilders (no shell strings);IsInstalledvia a boundedgoose acp --helpidentity check;Runtime()with Protocol ACP, native resume, pinned session dir,AssumeMcpSse=false, noStripEnv;RemoteAuthfile copy;InstallScript;PermissionSettings;InferenceConfig. - Register in
registry.goLoadDefaults(). - Test wiring — add Goose to
new_acp_agents_test.gomatrix; add SVGs. - Validate —
make -C apps/backendpackage tests (agents, registry, lifecycle, adapter),make lint-backend,make test-backend, and the real-adaptermake -C apps/backend test-e2e(gated, may need a real goose install / login). - Manual smoke —
make dev, confirm Goose appears in the agent/profile picker, start/prompt/cancel/resume, model/mode refresh, permissions,session/newMCP registration viaacpdbg mcp-probe goose. - Docs + i18n — update public docs; any user-facing copy via
t()/ i18n ratchets (agent name/description surface via the backend DTO, English). - Commit — single
feat(agents): add Goose ACP agent supportwith this plan doc included.
Risks
- ACP wire compatibility:
goose acpis documented ACP-compatible and its stdio entry is stable (low impact). A bridge shim is the fallback if a mismatch surfaces; verify with a real spawn early. - Tool-title humanization (from #1009): Goose humanizes MCP
tool_calltitles ("extension: read file · /arg"); confirm Kandev's stream layer handles or normalizes these, else add a small parser. - Global extensions auto-load: accepted; may delay
initializeif a slow unrelated extension is configured. - Detection:
goose acpis a blocking server; use its bounded--helpcommand, not the server itself or a provider-opening probe. - Windows support is unverified upstream; treated as a caveat.