diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-telemetry.ts b/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-telemetry.ts index 9edf94b1e7..4d38e6068f 100644 --- a/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-telemetry.ts +++ b/console/apps/switch-console-desktop/src/renderer/features/switch-buddy/buddy-telemetry.ts @@ -17,6 +17,7 @@ const PROVIDERS: readonly TelemetryProvider[] = [ 'copilot', 'kiro', 'mistral-vibe', + 'goose', ]; /** A provider id as telemetry may carry it: one of these, else `none`. */ diff --git a/console/apps/switch-console-desktop/src/shared/core/telemetry/renderer-events.ts b/console/apps/switch-console-desktop/src/shared/core/telemetry/renderer-events.ts index 7ffa6758f2..0f891d230d 100644 --- a/console/apps/switch-console-desktop/src/shared/core/telemetry/renderer-events.ts +++ b/console/apps/switch-console-desktop/src/shared/core/telemetry/renderer-events.ts @@ -97,6 +97,7 @@ export type RendererTelemetryEvents = { | 'copilot' | 'kiro' | 'mistral-vibe' + | 'goose' | 'none'; }; /** A message sent to the person's own switch-buddy: the how-manyth, from its chats. */ diff --git a/console/packages/agent-providers/README.md b/console/packages/agent-providers/README.md index d5b987013f..c6c37b6fd0 100644 --- a/console/packages/agent-providers/README.md +++ b/console/packages/agent-providers/README.md @@ -77,6 +77,7 @@ does not filter; use `pnpm exec vitest run ` for one provider. | pi | 1.5.0 | 8/10 (2026-11-05) | Run with `mistral/devstral-medium-latest`: set a provider's API key in the shell (the test passes `*_API_KEY` through), `SWITCH_PI_MODEL` to a `provider/model` that `pi --list-models` shows, and `SWITCH_PI_BIN` to run a `pi` other than the one on the PATH. Pi has no tool that asks the user (its `question` tool is an example extension, which errors outside the TUI) and no subagent tool, so `user-input` and `subagent` are skipped. Pi never asks before a tool runs: the Switch extension asks the adapter about every call, and auto mode approves edits and asks before commands, as Pi has no automatic review. A mid-turn message queues as its own turn. Without a credential Pi still starts, on a placeholder model that refuses every prompt, so the adapter reads the model from `get_state` and asks for a sign-in. | | kiro (ACP) | 3.0.0 | 9/10 (2026-11-04) | Kiro runs Switch's sessions on its V3 engine (it recognises the client); the run with the engine forced to V3 by flag matched. `user-input` is skipped: Kiro offers its `user_input` tool only in its spec workflows, so in the default `vibe` mode (and V2's default agent) it asks in prose and ends the turn. Once, the first session after a controller started was refused `session/set_model` (its `session/new` named no `model` option yet); the host's retry started it, and six more starts with a model did not repeat it. The suite skips itself until `kiro-cli whoami` says signed in; set `KIRO_API_KEY` in the shell to run it with a key, which the test passes through. | | mistral-vibe (ACP) | vibe-acp 3.1.0 | 10/10 (2026-11-06) | Run on Vibe's default model, Mistral Medium 3.5 (`mistral-vibe-cli-latest`), with the key in `$VIBE_HOME/.env`. A key set as `MISTRAL_API_KEY` in the shell works too; the test passes it, and `VIBE_HOME`, through. | +| goose (ACP) | 1.57.0 | 9/10 (2026-11-04, Amazon Linux 2023) | `user-input` skipped: Goose uses ACP form elicitation, which the generic client does not advertise (`userInput: false`); without the skip the scenario times out at 180s waiting for `user-input.requested`. Real-CLI scenarios run one at a time with 65s spacing; full back-to-back suite can hit Gemini free-tier limits. | | antigravity (retired `agy` adapter, kept for history) | 1.2.4 | 7/10 | Headless `agy` has no prompt channel at all: a tool that needs permission is auto-denied, so `approval-required` and `approval-declined` are skipped and the mode emits a `runtime.warning` at session start. `ask_question` is skipped by the CLI, so `user-input` is skipped. No steering — a mid-turn message queues as its own turn. No in-process cancel: an interrupt kills the process and the next turn respawns on `--conversation`. File tools run in the CLI's own scratch workspace unless `--add-dir ` is passed. Attachments are passed as file paths in the prompt text: the stream-json input accepts `text` blocks only and rejects `image`. Outside `full-access` a staged attachment is unreadable until its directory is passed as another `--add-dir`, which only takes effect at launch, so such a turn respawns first. A file the `download_attachment` Switch tool fetches lands under `~/.switch/sessions//media`, a directory named after a process the adapter never sees and created mid-turn, so outside `full-access` the session is given `~/.switch/sessions` at spawn and those downloads are readable without a respawn. | ## ACP providers diff --git a/console/packages/agent-providers/src/goose/goose-adapter.test.ts b/console/packages/agent-providers/src/goose/goose-adapter.test.ts new file mode 100644 index 0000000000..64b6b59eec --- /dev/null +++ b/console/packages/agent-providers/src/goose/goose-adapter.test.ts @@ -0,0 +1,171 @@ +import type * as fs from 'node:fs/promises'; +import { beforeEach, expect, it, vi } from 'vitest'; +import type { RuntimeMode } from '../adapter'; +import { FakeAppServer } from '../codex/fake-app-server'; +import type { ProviderRuntimeEvent } from '../events'; + +vi.mock('node:fs/promises', async (original) => ({ + ...(await original()), + realpath: async (path: string) => path, +})); +const servers: FakeAppServer[] = []; +vi.mock('node:child_process', () => ({ + spawn: () => { + const server = new FakeAppServer(); + server.replyAlways('initialize', () => ({ + agentCapabilities: { + loadSession: true, + promptCapabilities: { image: true, audio: false, embeddedContext: true }, + mcpCapabilities: { http: true, sse: false }, + }, + authMethods: [{ id: 'goose-provider', name: 'Configure Provider' }], + })); + server.replyAlways('session/new', () => ({ sessionId: 'native' })); + server.replyAlways('session/set_mode', () => ({})); + servers.push(server); + return server; + }, +})); +const { createGooseAdapter, gooseAcp, parseGooseInfo } = await import('./goose-adapter'); +beforeEach(() => { + servers.length = 0; +}); +async function setup(runtimeMode: RuntimeMode = 'approval-required') { + const adapter = createGooseAdapter(); + const events: ProviderRuntimeEvent[] = []; + adapter.subscribe((e) => events.push(e)); + await adapter.startSession({ + sessionId: 's', + cwd: '/work', + runtimeMode, + env: {}, + mcpServers: { switch: { transport: 'stdio', command: 'node', args: ['server.js'] } }, + connectorMcpServers: [], + }); + const server = servers.at(-1)!; + await adapter.sendTurn({ sessionId: 's', turnId: 't', text: 'go' }); + await server.waitFor('session/prompt'); + return { adapter, events, server }; +} +const flush = () => new Promise((resolve) => setImmediate(resolve)); + +// What Goose 1.57.0 sends: the tool call names its tool in `_meta`, the +// permission request for it does not, and the options are raw ids. +const toolCall = (toolCallId: string, extensionName: string, toolName: string, title: string) => ({ + sessionUpdate: 'tool_call', + toolCallId, + title, + _meta: { goose: { toolCall: { toolName, extensionName } } }, +}); +const permission = (id: number, toolCallId: string, title: string, rawInput: object) => ({ + id, + method: 'session/request_permission', + params: { + sessionId: 'native', + toolCall: { toolCallId, title, kind: 'other', rawInput, _meta: null }, + options: ['allow_always', 'allow_once', 'reject_once', 'reject_always'].map((kind) => ({ + optionId: kind, + name: kind, + kind, + })), + }, +}); + +it('puts every session in a Goose mode, since Goose defaults to approving everything', async () => { + expect( + (['approval-required', 'auto-accept-edits', 'auto', 'full-access'] as const).map((mode) => + gooseAcp.sessionMode?.(mode, undefined) + ) + ).toEqual(['approve', 'approve', 'smart_approve', 'auto']); + const { server } = await setup(); + expect(server.received.find((m) => m.method === 'session/set_mode')?.params).toEqual({ + sessionId: 'native', + modeId: 'approve', + }); +}); + +it('asks for a shell command as a command, offering only the once options', async () => { + const { adapter, events, server } = await setup(); + server.notify('session/update', { + sessionId: 'native', + update: toolCall('call_1', 'developer', 'shell', 'shell · ls'), + }); + server.send(permission(91, 'call_1', 'shell · ls', { command: 'ls' })); + await flush(); + const request = events.find((e) => e.type === 'request.opened'); + if (!request || request.type !== 'request.opened') throw new Error('missing approval'); + expect(request.requestType).toBe('command_execution_approval'); + expect(request.options).toEqual([ + { decision: 'accept', label: 'Allow once' }, + { decision: 'decline', label: 'Reject' }, + { decision: 'cancel', label: 'Cancel' }, + ]); + const item = events.find((e) => e.type === 'item.started' || e.type === 'item.updated'); + expect(item && 'item' in item ? item.item.type : undefined).toBe('command_execution'); + await adapter.respondToRequest('s', request.requestId, 'accept'); + await flush(); + expect(server.received.find((m) => m.id === 91)?.result).toEqual({ + outcome: { outcome: 'selected', optionId: 'allow_once' }, + }); +}); + +it('accepts file writes and edits by itself in auto-accept-edits, and still asks for commands', async () => { + const { events, server } = await setup('auto-accept-edits'); + server.send(permission(92, 'call_2', 'write · notes.txt', { path: 'notes.txt', content: 'hi' })); + server.send( + permission(93, 'call_3', 'edit · notes.txt', { path: 'notes.txt', before: 'a', after: 'b' }) + ); + await flush(); + for (const id of [92, 93]) + expect(server.received.find((m) => m.id === id)?.result).toEqual({ + outcome: { outcome: 'selected', optionId: 'allow_once' }, + }); + server.send(permission(94, 'call_4', 'shell · rm -rf build', { command: 'rm -rf build' })); + await flush(); + expect(events.some((e) => e.type === 'request.opened')).toBe(true); +}); + +it("runs the session's own MCP tools without asking, from the server named on the tool call", async () => { + const { events, server } = await setup(); + server.notify('session/update', { + sessionId: 'native', + update: toolCall('call_5', 'switch', 'send_message', 'send_message · hello'), + }); + server.send(permission(95, 'call_5', 'send_message · hello', { text: 'hello' })); + await flush(); + expect(server.received.find((m) => m.id === 95)?.result).toEqual({ + outcome: { outcome: 'selected', optionId: 'allow_once' }, + }); + expect(events.some((e) => e.type === 'request.opened')).toBe(false); +}); + +it("does not take Goose's own extensions for MCP servers", () => { + for (const extension of ['developer', 'summon', 'analyze', 'Extension Manager']) + expect( + gooseAcp.mcpServerOf?.( + { + toolCallId: 'c', + _meta: { goose: { toolCall: { toolName: 'x', extensionName: extension } } }, + }, + new Set() + ) + ).toBeUndefined(); + expect(gooseAcp.mcpServerOf?.({ toolCallId: 'c' }, new Set())).toBeUndefined(); +}); + +it('reads the provider and model from `goose info -v`', () => { + const info = (configuration: string) => + `goose Version:\n Version: 1.57.0\n\nPaths:\nConfig dir: /home/u/.config/goose\n\ngoose Configuration:\n${configuration} extensions:\n developer:\n enabled: true\n`; + expect( + parseGooseInfo(info(' GOOSE_MODEL: gemini-3.5-flash\n GOOSE_PROVIDER: google\n')) + ).toMatchObject({ status: 'authenticated', message: 'Uses google (gemini-3.5-flash).' }); + expect(parseGooseInfo(info('')).status).toBe('unauthenticated'); + expect(parseGooseInfo(info(' GOOSE_PROVIDER: google\n')).status).toBe('unauthenticated'); + expect( + parseGooseInfo('goose: unknown command "info"\nUsage: goose [OPTIONS] DRIVER DBSTRING') + ).toMatchObject({ + status: 'unknown', + message: + 'The `goose` on PATH is not the Goose agent CLI. Install Goose from https://goose-docs.ai.', + }); +}); diff --git a/console/packages/agent-providers/src/goose/goose-adapter.ts b/console/packages/agent-providers/src/goose/goose-adapter.ts new file mode 100644 index 0000000000..dc0b759b0a --- /dev/null +++ b/console/packages/agent-providers/src/goose/goose-adapter.ts @@ -0,0 +1,147 @@ +import { createAcpAdapter, type AcpAdapter } from '../acp/acp-adapter'; +import type { AcpAdapterOptions, AcpProviderHooks } from '../acp/hooks'; +import type { AcpPermissionRequest, AcpToolCall } from '../acp/protocol'; +import type { RuntimeMode } from '../adapter'; +import type { ItemType } from '../events'; +import { execProvider } from '../provider-process'; +import { commandOutput, readiness, signInWith, type ProviderReadiness } from '../readiness'; + +const GOOSE_LOGIN = 'goose configure'; + +// Goose's bundled extensions, as `goose info -v` lists them. A tool call from +// any other extension is from an MCP server the session registered. +const GOOSE_EXTENSIONS = new Set([ + 'analyze', + 'apps', + 'chatrecall', + 'code_execution', + 'developer', + 'Extension Manager', + 'scheduler', + 'skills', + 'summarize', + 'summon', + 'todo', + 'tom', +]); + +// A new Goose session starts in the machine's GOOSE_MODE, `auto` unless set, +// which approves every tool call; so every session gets a mode. Goose keeps it +// on the session and never writes it to its config. +const GOOSE_MODES: Record = { + 'approval-required': 'approve', + 'auto-accept-edits': 'approve', + auto: 'smart_approve', + 'full-access': 'auto', +}; + +const ITEM_TYPES: Record = { + 'developer/shell': 'command_execution', + 'developer/write': 'file_change', + 'developer/edit': 'file_change', + 'summon/delegate': 'subagent', +}; + +function gooseTool(toolCall: AcpToolCall): { extension: string; tool: string } | undefined { + const call = (toolCall._meta?.goose as { toolCall?: unknown } | undefined)?.toolCall as + | { extensionName?: unknown; toolName?: unknown } + | undefined; + return typeof call?.extensionName === 'string' && typeof call.toolName === 'string' + ? { extension: call.extensionName, tool: call.toolName } + : undefined; +} + +/** Reads the provider and model `goose info -v` resolves, from the environment or Goose's config. */ +export function parseGooseInfo(output: string): ProviderReadiness { + // pressly/goose, a database migration tool, installs a binary of the same name. + if (!/^goose Version:/m.test(output)) + return readiness( + 'unknown', + 'The `goose` on PATH is not the Goose agent CLI. Install Goose from https://goose-docs.ai.' + ); + const setting = (key: string) => + output.match(new RegExp(`^[ \\t]+${key}:[ \\t]*(\\S.*)$`, 'm'))?.[1]?.trim(); + const provider = setting('GOOSE_PROVIDER'); + const model = setting('GOOSE_MODEL'); + if (!provider || !model) return readiness('unauthenticated', signInWith(GOOSE_LOGIN)); + return readiness('authenticated', `Uses ${provider} (${model}).`); +} + +/** + * Goose's permission request carries no `_meta` and always the kind `other`, + * only a title naming the tool (`shell · ls`, `write · notes.txt`), so the + * kind is read from the title and the tool's arguments. It offers + * `allow_always`, which Goose writes to its machine-wide `permission.yaml`, + * outliving the session and covering every Goose session on the machine: + * only the once options are kept, with readable labels. + */ +export function gooseRequest(request: AcpPermissionRequest): void { + const { toolCall } = request; + const tool = toolCall.title?.match(/^(\w+) · /)?.[1]; + const input = toolCall.rawInput ?? {}; + if (tool === 'shell' && typeof input.command === 'string') toolCall.kind = 'execute'; + else if ((tool === 'write' || tool === 'edit') && typeof input.path === 'string') + toolCall.kind = 'edit'; + request.options = request.options.flatMap((option) => + option.kind === 'allow_once' + ? [{ ...option, name: 'Allow once' }] + : option.kind === 'reject_once' + ? [{ ...option, name: 'Reject' }] + : [] + ); +} + +/** Goose's `goose acp`, with its session modes and its tool and permission metadata. */ +export const gooseAcp: AcpProviderHooks = { + provider: 'goose', + label: 'Goose', + defaultBinary: 'goose', + capabilities: { + modelSwitchInSession: true, + steering: false, + resume: true, + approvals: true, + userInput: false, + }, + launch: ({ binaryPath, env }) => ({ command: binaryPath, args: ['acp'], env }), + loginCommand: GOOSE_LOGIN, + inheritEnv: ['GOOSE_PROVIDER', 'GOOSE_MODEL', 'GOOSE_DISABLE_KEYRING'], + // Goose has no account: it is ready once a provider and model are + // configured. `initialize` offers the same `goose-provider` method either + // way, so the handshake cannot tell. `goose info -v` resolves both without a + // model call; the provider's key is taken as given, and a bad one fails the + // first turn. + checkSignIn: async ({ binaryPath, cwd, env }) => { + let output: string; + try { + output = ( + await execProvider(binaryPath, ['info', '-v'], { + cwd, + env, + timeout: 15000, + maxBuffer: 1024 * 1024, + }) + ).stdout; + } catch (error) { + output = commandOutput(error); + } + return parseGooseInfo(output); + }, + sessionMode: (mode) => GOOSE_MODES[mode], + mcpServerOf: (toolCall) => { + const extension = gooseTool(toolCall)?.extension; + return extension !== undefined && !GOOSE_EXTENSIONS.has(extension) ? extension : undefined; + }, + itemType: (toolCall) => { + const call = gooseTool(toolCall); + return call ? ITEM_TYPES[`${call.extension}/${call.tool}`] : undefined; + }, + permission: (_context, request) => { + gooseRequest(request); + return undefined; + }, +}; + +export function createGooseAdapter(options: AcpAdapterOptions = {}): AcpAdapter { + return createAcpAdapter(gooseAcp, options); +} diff --git a/console/packages/agent-providers/src/goose/goose.integration.test.ts b/console/packages/agent-providers/src/goose/goose.integration.test.ts new file mode 100644 index 0000000000..5e130dde7a --- /dev/null +++ b/console/packages/agent-providers/src/goose/goose.integration.test.ts @@ -0,0 +1,23 @@ +import { spawnSync } from 'node:child_process'; +import { describeConformance, echoMcpServerSpec } from '../testing/index'; +import { createGooseAdapter } from './goose-adapter'; + +describeConformance('goose', { + createAdapter: async () => createGooseAdapter(), + skip: { + 'user-input': + 'Goose 1.57.0 asks through ACP form elicitation; the generic ACP client does not advertise it (hooks set userInput: false). Verified 2026-11-04.', + }, + unavailableReason: async () => { + const probe = spawnSync('goose', ['info', '-v'], { encoding: 'utf8' }); + if (probe.error || probe.status !== 0) return 'the goose binary is not on PATH'; + return /^[ \t]+GOOSE_PROVIDER:/m.test(probe.stdout) + ? null + : 'Goose has no provider configured; run `goose configure`'; + }, + mcpServers: { echo: echoMcpServerSpec() }, + // The harness hands the CLI a minimal environment. Goose reads its provider + // and model from its config; a headless machine has no keyring to read the + // provider's key from, so it is read from Goose's secrets file instead. + env: { GOOSE_DISABLE_KEYRING: '1' }, +}); diff --git a/console/packages/agent-providers/src/index.ts b/console/packages/agent-providers/src/index.ts index a4e89311df..3049173428 100644 --- a/console/packages/agent-providers/src/index.ts +++ b/console/packages/agent-providers/src/index.ts @@ -58,6 +58,7 @@ export { createDeepseekHarnessAdapter, deepseekHarnessAcp, } from './deepseek-harness/deepseek-harness-acp'; +export { gooseAcp, createGooseAdapter } from './goose/goose-adapter'; export { kiroAcp, createKiroAdapter } from './kiro/kiro-acp'; export { ChatProjector } from './session-v1/chat-projector'; export { EventOutbox } from './session-v1/event-outbox'; diff --git a/console/packages/agent-providers/src/providers/registry.ts b/console/packages/agent-providers/src/providers/registry.ts index 382b6f938e..bb571b3dc2 100644 --- a/console/packages/agent-providers/src/providers/registry.ts +++ b/console/packages/agent-providers/src/providers/registry.ts @@ -9,6 +9,7 @@ import { checkCodexSignIn, CODEX_LOGIN } from '../codex/sign-in'; import { copilotAcp } from '../copilot/copilot-acp'; import { cursorAcp } from '../cursor/cursor-adapter'; import { deepseekHarnessAcp } from '../deepseek-harness/deepseek-harness-acp'; +import { gooseAcp } from '../goose/goose-adapter'; import { kiroAcp } from '../kiro/kiro-acp'; import { mistralVibeAcp } from '../mistral-vibe/mistral-vibe-acp'; import { createOpencodeAdapter } from '../opencode/opencode-adapter'; @@ -125,6 +126,7 @@ export const PROVIDER_RUNTIMES: readonly ProviderRuntime[] = [ createPiAdapter({ binaryPath, ...(logger ? { logger } : {}) }), checkSignIn: checkPiSignIn, }, + acpProviderRuntime(gooseAcp), ]; const RUNTIMES = new Map(PROVIDER_RUNTIMES.map((runtime) => [runtime.id, runtime])); diff --git a/console/packages/plugins/src/agents/impl/goose/icon.ts b/console/packages/plugins/src/agents/impl/goose/icon.ts new file mode 100644 index 0000000000..3e5bccea3c --- /dev/null +++ b/console/packages/plugins/src/agents/impl/goose/icon.ts @@ -0,0 +1,16 @@ +import type { AgentIconAsset } from '@switch-console/core/agents/plugins'; + +export const icon: AgentIconAsset = { + kind: 'svg', + alt: 'Goose', + invertInDark: true, + variants: [ + { + minSize: 0, + light: ` + + +`, + }, + ], +}; diff --git a/console/packages/plugins/src/agents/impl/goose/index.ts b/console/packages/plugins/src/agents/impl/goose/index.ts new file mode 100644 index 0000000000..0de952670a --- /dev/null +++ b/console/packages/plugins/src/agents/impl/goose/index.ts @@ -0,0 +1,77 @@ +import { definePlugin, registerPluginBehavior } from '@switch-console/core/agents/plugins'; +import { icon } from './icon'; + +// CONFIGURE=false keeps the script from starting `goose configure`, which asks +// questions on the terminal; the person runs it as the sign-in command instead. +const GOOSE_INSTALL_COMMAND = + 'curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | CONFIGURE=false bash'; + +export const plugin = definePlugin( + { + id: 'goose', + name: 'Goose', + description: + 'Block’s open-source Goose agent over ACP, on the model provider you configure for it.', + websiteUrl: 'https://goose-docs.ai/docs/guides/acp-clients', + }, + { + autoApprove: { + kind: 'supported', + }, + effort: { + kind: 'none', + }, + hostDependency: { + id: 'goose', + binaryNames: ['goose'], + installCommands: { + macos: [ + { + method: 'curl', + command: GOOSE_INSTALL_COMMAND, + }, + ], + linux: [ + { + method: 'curl', + command: GOOSE_INSTALL_COMMAND, + }, + ], + }, + updates: { + kind: 'supported', + releaseSource: { + kind: 'none', + }, + update: { + kind: 'package-manager', + }, + }, + }, + mcp: { + kind: 'none', + }, + models: { + kind: 'none', + }, + plugins: { + kind: 'none', + }, + prompt: { + kind: 'none', + }, + sessions: { + kind: 'resumable', + }, + repoAgents: { kind: 'none' }, + }, + { icon } +); + +export const provider = registerPluginBehavior(plugin, { + prompt: { + buildCommand: () => { + throw new Error('Goose runs through the ACP session host.'); + }, + }, +}); diff --git a/console/packages/plugins/src/agents/plugin-registry.ts b/console/packages/plugins/src/agents/plugin-registry.ts index a0a8640dff..b7785fedd4 100644 --- a/console/packages/plugins/src/agents/plugin-registry.ts +++ b/console/packages/plugins/src/agents/plugin-registry.ts @@ -9,6 +9,7 @@ import { provider as codex } from './impl/codex'; import { provider as copilot } from './impl/copilot'; import { provider as cursor } from './impl/cursor'; import { provider as deepseekHarness } from './impl/deepseek-harness'; +import { provider as goose } from './impl/goose'; import { provider as kiro } from './impl/kiro'; import { provider as mistralVibe } from './impl/mistral-vibe'; import { provider as opencode } from './impl/opencode'; @@ -28,6 +29,7 @@ for (const p of [ deepseekHarness, pi, mistralVibe, + goose, ]) { pluginRegistry.register(p); } diff --git a/core/switch_core/official_templates/switch-buddy/template.yaml b/core/switch_core/official_templates/switch-buddy/template.yaml index 25ba46bac9..7ba1643a8f 100644 --- a/core/switch_core/official_templates/switch-buddy/template.yaml +++ b/core/switch_core/official_templates/switch-buddy/template.yaml @@ -16,7 +16,7 @@ params: provider: type: provider description: The coding agent that runs it. The first one ready on its machine is chosen. - default: [claude, codex, opencode, cursor, antigravity, deepseek-harness, pi, copilot, kiro, mistral-vibe] + default: [claude, codex, opencode, cursor, antigravity, deepseek-harness, pi, copilot, kiro, mistral-vibe, goose] input: advanced machine: type: machine diff --git a/core/switch_core/providers/registry.py b/core/switch_core/providers/registry.py index 21ea7bf1b8..1b0eab2ced 100644 --- a/core/switch_core/providers/registry.py +++ b/core/switch_core/providers/registry.py @@ -208,6 +208,18 @@ def __post_init__(self) -> None: label="Mistral Vibe", sign_in_command="vibe-acp --setup", ), + AgentProvider( + id="goose", + label="Goose", + sign_in_command="goose configure", + connector_type="Goose CLI", + tools=( + ToolSpec(name="shell", description="Executes shell commands"), + ToolSpec(name="write", description="Writes files"), + ToolSpec(name="edit", description="Edits existing files"), + ToolSpec(name="delegate", description="Delegates to a subagent"), + ), + ), ) diff --git a/core/tests/switch_core/management/test_advanced_config.py b/core/tests/switch_core/management/test_advanced_config.py index d5ef651d5c..b328bf5672 100644 --- a/core/tests/switch_core/management/test_advanced_config.py +++ b/core/tests/switch_core/management/test_advanced_config.py @@ -17,7 +17,7 @@ def test_a_definition_refuses_a_provider_switch_does_not_run() -> None: DefinitionV1(provider="gemini") assert ( "unknown provider 'gemini'; one of claude, codex, opencode, antigravity, cursor, " - "deepseek-harness, pi, copilot, kiro, mistral-vibe" in str(raised.value) + "deepseek-harness, pi, copilot, kiro, mistral-vibe, goose" in str(raised.value) ) @@ -35,6 +35,7 @@ def test_the_served_provider_list() -> None: ("copilot", "GitHub Copilot"), ("kiro", "Kiro CLI"), ("mistral-vibe", "Mistral Vibe"), + ("goose", "Goose"), ] by_id = {provider["id"]: provider for provider in providers} served = advanced_config_schema()["providers"] @@ -58,6 +59,7 @@ def test_the_served_schema() -> None: "copilot", "kiro", "mistral-vibe", + "goose", } assert [field["key"] for field in providers["claude"]["fields"]] == [ "tools", @@ -83,6 +85,7 @@ def test_the_served_schema() -> None: assert providers["antigravity"] == {"fields": []} assert providers["copilot"] == {"fields": []} assert providers["kiro"] == {"fields": []} + assert providers["goose"] == {"fields": []} claude = {field["key"]: field for field in providers["claude"]["fields"]} assert claude["isolation"] == { "key": "isolation", diff --git a/core/tests/switch_core/management/test_gateway_routes.py b/core/tests/switch_core/management/test_gateway_routes.py index 6c6c8025f2..cb179ea224 100644 --- a/core/tests/switch_core/management/test_gateway_routes.py +++ b/core/tests/switch_core/management/test_gateway_routes.py @@ -493,6 +493,7 @@ async def test_the_advanced_config_schema_is_served(self, harness: Harness) -> N "copilot", "kiro", "mistral-vibe", + "goose", } assert providers["cursor"] == {"fields": []} assert providers["kiro"] == {"fields": []} @@ -525,6 +526,7 @@ async def test_the_provider_list_is_served(self, harness: Harness) -> None: "copilot", "kiro", "mistral-vibe", + "goose", ] assert providers[0]["label"] == "Claude Code" for entry in providers: diff --git a/core/tests/switch_core/providers/test_provider_registry.py b/core/tests/switch_core/providers/test_provider_registry.py index 56124a0f77..ae9cf2ae83 100644 --- a/core/tests/switch_core/providers/test_provider_registry.py +++ b/core/tests/switch_core/providers/test_provider_registry.py @@ -77,6 +77,7 @@ def test_the_stored_identifiers_of_existing_providers_are_unchanged() -> None: "copilot": ("copilot", "GitHub Copilot CLI"), "kiro": ("kiro", "Kiro CLI"), "mistral-vibe": ("mistral-vibe", "Mistral Vibe"), + "goose": ("goose", "Goose CLI"), } @@ -102,6 +103,7 @@ def test_the_stored_identifiers_of_existing_providers_are_unchanged() -> None: "mistral-vibe/mistral-vibe-acp.ts", r"MISTRAL_VIBE_LOGIN = '([^']+)'", ), + "goose": ("goose/goose-adapter.ts", r"GOOSE_LOGIN = '([^']+)'"), } @@ -121,7 +123,7 @@ def test_an_unknown_provider_is_refused_with_the_ones_there_are() -> None: agent_provider("gemini") assert str(raised.value) == ( "unknown provider 'gemini'; one of claude, codex, opencode, antigravity, cursor, " - "deepseek-harness, pi, copilot, kiro, mistral-vibe" + "deepseek-harness, pi, copilot, kiro, mistral-vibe, goose" )