Skip to content

feat(agent-providers): Goose as an agent provider - #1438

Closed
RajdeepKushwaha5 wants to merge 3 commits into
sandbox-quantum:mainfrom
RajdeepKushwaha5:feat/goose-provider
Closed

RajdeepKushwaha5 wants to merge 3 commits into
sandbox-quantum:mainfrom
RajdeepKushwaha5:feat/goose-provider

Conversation

@RajdeepKushwaha5

@RajdeepKushwaha5 RajdeepKushwaha5 commented Nov 4, 2026 •

Copy link
Copy Markdown

Closes #780

What this changes

Goose becomes an agent provider. A Switch agent can run on Goose (goose acp): it is created in Switch Console with a model, talks in rooms, and asks for approvals like the other ACP agents. It is an ACP hooks file on the generic adapter, a plugin, and one line in each registry, as add-an-agent-provider.md describes.

Everything below was checked against Goose v1.57.0's own source.

Sign-in, without signing in. Goose has no account; it signs in to the model provider chosen with goose configure. The check first opens goose acp and reads agentInfo from initialize (about a quarter of a second), because another tool, pressly/goose (a database migration CLI), also installs as goose; anything that does not answer as Goose reads as unknown with that hint, instead of as signed in. It then reads the provider choice the way Goose resolves it (GOOSE_PROVIDER, else active_provider, else GOOSE_PROVIDER in config.yaml; the model from GOOSE_MODEL, else providers.<p>.model), honours GOOSE_PATH_ROOT and each platform's config directory, and never touches the keyring or calls a model. An empty or comment-only config.yaml reads as not configured, and an unreadable one as unknown without its contents. A wrong key shows on the first turn. No authenticate is ever sent.

Modes. approval-required and auto-accept-edits run in approve, auto in smart_approve (Goose's own reviewer) and full-access in auto. Goose is launched with GOOSE_MODE=approve so it is safe before the session's mode is set.

Approvals are never saved for good. Goose offers allow_always and reject_always, and writes them to its permission.yaml, so one click would stop it asking about that tool in every later session, approval-required ones included. The hooks offer only allow once and reject, and give them readable names (Goose names its options after their ids, so the card would read allow_once).

Session naming is off. Goose names each session with a model call of its own. Switch never shows those names, so GOOSE_DISABLE_SESSION_NAMING defaults to true (a machine that sets it keeps its value). This saves a call per session, and on a local model the naming calls ran for hours and starved the turns.

Tool calls. Goose sends every tool call with no ACP kind, and its permission requests with no _meta. Without help, auto-accept-edits would ask about every edit and the activity card would not tell a command from a file change. The hooks:

  • type Goose's developer tools from _meta.goose.toolCall (shell as a command, write and edit as file changes) and its summon extension's delegate tool as a subagent;
  • give a permission request its kind from Goose's title (shell · ls, write · notes.txt), so auto-accept-edits allows edits and the approval card has the right type. Only Goose's unprefixed built-in names match, so a session MCP server can never be taken for one;
  • read a tool's MCP server from extensionName, leaving out Goose's built-in extensions, so the session's own servers are allowed and Goose's tools are not shown as connector calls.

Install. The plugin offers Goose's install script on macOS and Linux, Homebrew (block-goose-cli) on macOS and the PowerShell script on Windows, all with CONFIGURE=false: the scripts otherwise end by running goose configure, which waits for answers Console's installer cannot give. Updates use goose update.

Environment. GOOSE_PROVIDER, GOOSE_MODEL, GOOSE_PATH_ROOT, GOOSE_DISABLE_KEYRING, GOOSE_DISABLE_SESSION_NAMING, GOOSE_ADDITIONAL_CONFIG_FILES and GROQ_API_KEY are passed through; the other common provider keys already are.

Core. One entry in the provider table: label Goose, connector type Goose CLI like the other providers, sign-in goose configure, and Goose's built-in tools.

Outside the files the guide lists, each a list of every provider that Goose had to join:

  • switch-buddy/template.yaml and template_guide.py: the providers a template may name.
  • chats/views.py: the provider shown for an agent registered by hand.
  • Tests that list every provider: test_provider_registry.py, test_advanced_config.py, test_gateway_routes.py, test_known_agents.py, test_offline_owner_reply.py, known-agent-type.test.ts and session-launch.test.ts. Without these the suite fails as soon as a provider is added.
  • agent-controller/src/status.test.ts counted five providers by hand; it now counts them from PROVIDERS, so the next provider does not break it.
  • js-yaml, already used by the desktop app, to read config.yaml.

Not changed: giving a remote machine a login from Console (out of scope in the issue). For Goose it refuses with a clear message.

The issue's "Done when", and where each is shown:

  • Installed / not installed and signed in / signed out detected without starting a login, with a "goose configure" hint: the check above (it also tells Block's Goose from another goose), precheck answering provider_login_missing with an empty GOOSE_PATH_ROOT, and the unit tests for every outcome.
  • In Console's create-agent flow, with a model: the video (gemini-2.5-flash). Advanced settings are empty.
  • Joins a room, reads context and answers a mention: the video (Mattermost room) and the headless controller run.
  • Tool use on the activity card; approvals approved and denied from the chat: the video, and the real-CLI approval-required and approval-declined scenarios.
  • A mid-turn message is queued, !interrupt stops a turn, the conversation resumes after a restart: real-CLI steer-mid-turn, interrupt and resume.
  • Auto-approve works and the chosen model is used: real-CLI file-write-full-access, and the runs on the models named in the summary below.
  • Runs on a headless agent controller and in Console: the controller run below, and the video.
  • Real-CLI integration test passes: every scenario passed, user-input skipped with its reason, summary below.
  • Unit tests for the hooks: 33, below.
  • Video: in the section below.

How it was tested

Unit tests: 33 for the hooks: launch and environment, session naming, the mode map, a goose that is not Block's (no ACP answer, or another agent's), every sign-in outcome (environment, both config layouts, a mix, empty and comment-only files, unreadable config, each platform's directory, GOOSE_PATH_ROOT), MCP server identity, item typing, subagents, the permission kinds, including titles that must not match, and the options offered.

Console packages (on the current main): build, typecheck, lint and format check pass. In agent-providers (921 passed), plugins (135) and agent-controller (360), and the desktop agent tests (294), the only failures on this Windows machine are 14 tests that fail the same way on an untouched main: symlinks without the privilege (hosted-provider, control-port, self-update), POSIX shell scripts (release-keys, the Antigravity launcher) and process handling (stdio-json-rpc, claude-sdk-spawn, attachments, opencode-console).

Core: ruff format --check, ruff check and mypy clean. The provider registry, advanced config, known agents, offline reply, template and gateway route tests pass with Goose; four controller tests in test_gateway_routes.py (owner isolation, working directory, machine rename) time out the same way on main here.

Headless controller: switch-agent-controller precheck reports {"provider":"goose","installed":true,"version":"1.57.0","auth":"ok","auth_source":"local"}, and with an empty GOOSE_PATH_ROOT it reports "auth":"missing","reason":"provider_login_missing" with the goose configure hint.

On a headless agent controller, built from this branch and enrolled on Windows as windows-goose with switch-agent-controller enroll, 2026-11-09: doctor reports ok goose Installed 1.57.0, authenticated: Goose has a model provider configured. Credentials are checked on the first turn., with the enrollment, credential, server and shared host checks ok. With run going, an agent placed on that controller through the management API (provider: goose, Google gemini-3.5-flash through GOOSE_PROVIDER and GOOSE_MODEL, approvals on) came up running and, asked in a Switch chat "What is 17 times 3? Reply with just the number.", answered 51.


Adding or changing an agent CLI

CLI and version: Goose 1.57.0 (official Windows build), Windows 11. The suite ran on Gemini (Goose's google provider) and earlier on a local model, Qwen 3.5 9B in LM Studio; the video uses gemini-2.5-flash.

Real-CLI test summary (pnpm exec vitest run src/goose/goose.integration.test.ts):

Full run, gemini-3-flash-preview (free tier):
 ✓ goose conformance > simple-turn 6063ms
 ✓ goose conformance > file-write-full-access 11253ms
 × goose conformance > approval-required 17212ms      (rate limit, rerun below)
 × goose conformance > approval-declined 600017ms     (timed out, rerun below)
 ✓ goose conformance > interrupt 9111ms
 ✓ goose conformance > steer-mid-turn 12543ms
 ✓ goose conformance > resume 19493ms
 ↓ goose conformance > user-input 1ms [Goose 1.57.0 asks questions only through ACP form elicitation, which the generic adapter does not advertise (2026-11-01).]
 × goose conformance > subagent 27536ms               (rate limit, rerun below)
 ✓ goose conformance > mcp-registered 9666ms
 Tests  3 failed | 6 passed | 1 skipped (10)

Reruns, one scenario at a time (-t <name>):
 ✓ goose conformance > approval-required 25544ms      gemini-3-flash-preview
 ✓ goose conformance > approval-declined 40.4s        gemini-2.5-flash-lite
 ✓ goose conformance > subagent 29.7s                 gemini-2.5-flash-lite
 ✓ goose conformance > interrupt 8.4s                 gemini-2.5-flash-lite
 ✓ goose conformance > mcp-registered 7.6s            gemini-2.5-flash-lite

Every scenario passed against the real CLI. The free Gemini tier allows 5 requests a minute and 20 a day per model, which a full run goes past: approval-required and subagent failed on 429 rate limits (in Goose's request log) and were rerun alone. approval-declined timed out on Gemini 3 Flash and on the local Qwen 3.5 9B (whose event log shows it asking for the declined tool again), and passes on Gemini 2.5 Flash-Lite. On Qwen every other scenario passed too. user-input is skipped: Goose 1.57.0 asks questions only through ACP form elicitation, which the generic adapter does not advertise. The deadline is 600 s because Goose runs whatever model it is set to, a local one included.

Video (recorded from this branch in Switch Console on Windows, Goose 1.57.0 on gemini-2.5-flash). It shows:

  • the CLI marked as signed in, in Switch Console
  • creating an agent with it and picking a model
  • the agent replying in a room
  • a shell command asking for permission first

One thing in the video is not from this change: on Windows the model picker says Goose "is not installed or its selected executable cannot be found" while the provider list shows it ready. getProviderReadiness passes the full executable path to where, which rejects a path ("Invalid pattern"); typing the model works, as the video shows.

demo.mp4

# Conflicts:
#	console/packages/agent-providers/README.md
@RajdeepKushwaha5

Copy link
Copy Markdown
Author

Hi @petr-sandbox, the Goose provider is ready. It passes the real-CLI conformance run (9/10, user-input skipped with the reason), an agent on a headless agent controller answered in a room, and the video at the top shows it end to end. Could you please review it when you have time? Thank you!

@christian-mcdermott

Copy link
Copy Markdown
Collaborator

Closing as superseded: issue #780 was resolved by #1439, merged on 2026-11-11. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Goose as an agent provider

2 participants