Skip to content

feat(agent-providers): add Goose as an agent provider (#780) - #1439

Merged
petr-sandbox merged 8 commits into
sandbox-quantum:mainfrom
Souravrajvi0:feat/goose-provider
Nov 11, 2026
Merged

petr-sandbox merged 8 commits into
sandbox-quantum:mainfrom
Souravrajvi0:feat/goose-provider

Conversation

@Souravrajvi0

@Souravrajvi0 Souravrajvi0 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Adds Goose as an agent provider. Goose runs as goose acp on the generic ACP adapter, so this is a hooks file, a plugin, a line in each registry and an entry in core's provider table.

Three files outside the ones add-an-agent-provider.md lists also needed goose, because each keeps its own hardcoded provider list that the registrations don't reach: the switch-buddy telemetry provider type (buddy-telemetry.ts), the renderer telemetry event type (renderer-events.ts), and the switch-buddy template's default providers (switch-buddy/template.yaml). The typecheck and core tests caught them. They could be derived from the registry in a follow-up, so the next provider doesn't need them.

Closes #780

What Goose does differently, and how it was found

Every hook below comes from a real goose acp session (Goose 1.57.0, Ubuntu 24.04 under WSL2). I drove it over raw ACP and recorded each JSON-RPC message before writing the hooks. Some of what Goose sends differs from what the issue thread assumed.

Goose 1.57.0 behaviour (observed) Hook
A new session starts in mode auto ("Automatically approve tool calls"), whatever the runtime mode. sessionMode: approval-required and auto-accept-edits → approve, auto → smart_approve, full-access → auto. session/set_mode is answered with current_mode_update.
session/request_permission has _meta: null and kind: "other". The title is shell · <command>, write · <path> or edit · <path>, not developer: shell · …. permission sets kind to execute or edit from the title prefix, and only when the tool's rawInput fits (command for shell, path for write and edit). Without this, every command shows as a generic tool approval and auto-accept-edits never accepts an edit.
Options are offered as raw ids: allow_always, allow_once, reject_once, reject_always. Choosing allow_always wrote always_allow: [shell] to ~/.config/goose/permission.yaml, a machine-wide rule that outlives the session. Only allow_once and reject_once are offered, labelled "Allow once" and "Reject". The generic adapter would otherwise show allow_always as "allow for this session".
The earlier tool_call update carries _meta.goose.toolCall = { extensionName, toolName }, e.g. developer/shell, developer/write, developer/edit. An MCP server's tools carry the server's name. The permission request reuses the same toolCallId. mcpServerOf returns the extension unless it is one of Goose's bundled extensions (the list goose info -v prints), so the generic adapter's per-call server map makes the session's own MCP tools run without asking. itemType maps shell, write, edit and summon/delegate.
initialize always offers the one goose-provider method ("Configure Provider"), configured or not, and already advertises image and embedded-context prompts and HTTP MCP. No authMethodId and no promptCapabilities override.
goose info -v prints GOOSE_PROVIDER: … and GOOSE_MODEL: … under "goose Configuration" once configured (from the environment or config.yaml), and neither line when not. It never prints the provider's key (checked). checkSignIn runs goose info -v and reads those two lines, with no model call. Output without goose Version: is reported as a different goose on PATH (pressly/goose, the migration tool, uses the same name).

inheritEnv passes GOOSE_PROVIDER, GOOSE_MODEL and GOOSE_DISABLE_KEYRING. Provider keys such as GOOGLE_API_KEY and OPENAI_API_KEY are already passed through.

The icon is Goose's mark from block/goose (documentation/static/img/goose.svg, Apache-2.0), reduced to its viewBox and single path.

How it was tested

Unit tests (src/goose/goose-adapter.test.ts, 6 passing). They are built on the payloads Goose actually sent:

  • each mode mapping, and session/set_mode sent on start;
  • a shell permission request with _meta: null opens a command_execution_approval with only Allow once / Reject / Cancel, and answers allow_once;
  • in auto-accept-edits, write and edit requests are accepted without asking, and a command still asks;
  • a tool from the session's own MCP server runs without asking, matched through the earlier tool call;
  • Goose's bundled extensions are not taken for MCP servers;
  • goose info -v parsing: configured, unconfigured, provider without model, and a pressly/goose binary.

Checks run

  • pnpm -r run typecheck and pnpm run format:check in console/ (clean).
  • pnpm vitest run --project node --project main-db in apps/switch-console-desktop: 5416 passed, 6 skipped (browser project not run).
  • just check, just typecheck at repo root (clean).
  • Core provider/registry tests updated for Goose; test_provider_registry.py passes.

Adding or changing an agent CLI

CLI and version: Goose 1.57.0 (goose acp).

Real-CLI test summary

Recorded on Amazon Linux 2023.12 (self-hosted worker), google / gemini-3-flash-preview, GOOSE_DISABLE_KEYRING=1, secrets in ~/.config/goose/secrets.yaml. Scenarios run one at a time with 65s between them (pnpm exec vitest run src/goose/goose.integration.test.ts -t "<scenario>"). Earlier WSL2 runs used the same adapter against Gemini free tier.

✓ simple-turn               PASS (~25s; second key after first hit quota)
✓ file-write-full-access    PASS (~4s)
✓ approval-required         PASS (~5s)
✓ approval-declined         PASS (~7s)
✓ interrupt                 PASS (~6s)
✓ steer-mid-turn            PASS (~13s; queues mid-turn message; steering: false)
✓ resume                    PASS (~30s; third key after rotate)
✓ subagent                  PASS (~8s; summon/delegate → subagent item)
✓ mcp-registered            PASS (~5s; echo MCP, no approval in approval-required mode)
· user-input                skipped in suite — Goose 1.57.0 / ACP form elicitation; hooks set userInput: false (2026-11-04)

9/10 conformance scenarios pass; user-input is a documented skip (see goose.integration.test.ts and console/packages/agent-providers/README.md).

A single uninterrupted full-file run on the same host still hit Gemini free-tier daily limits (turn.completed → error on later scenarios). Spaced single-scenario runs are the reliable way to finish the suite on free tier.

Headless agent-controller (Linux): Amazon Linux 2023.12; local Switch (just up, switch-core with agent_management); switch-agent-controller enroll + run --env-file (Goose env); doctor reports goose authenticated; managed goose agent created, host started, added to bridged Mattermost Town Square room. No browser recording on this VM (DISPLAY unset).

Video (Console): https://github.com/Souravrajvi0/switch/releases/download/goose-demo-video/GOOSE_AGENT_small.mp4 (3 min 21 s, 7.1 MB)

Recorded on Windows 11 + WSL2 (Ubuntu 24.04), Switch Console from this branch with the local server built from the checkout, Goose 1.57.0 on Gemini:

  • 0:10: Goose signed in in Agent providers (Found v1.57.0)

  • 0:45: creating an agent with Goose and setting its model

  • 1:20: messaging the agent in its chat (a Switch room)

  • 2:30: the shell command asks first, shell · echo demo > demo.txt, with only Allow once / Reject / Cancel (no machine-wide "always allow")

  • 3:05: approved, the command runs, switch: post message runs without asking (the session's own MCP server), and the agent replies "Done — created demo.txt"

  • 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

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Souravrajvi0 and others added 8 commits November 11, 2026 17:45
Run Goose through `goose acp` on the generic ACP adapter, with hooks for
what Goose 1.57.0 does differently, each checked against a real session:

- Goose starts every session in `auto`, which approves every tool call,
  so each session is put in the Goose mode for its runtime mode.
- Its permission requests carry no `_meta` and always the kind `other`;
  the kind is read from the title (`shell · …`, `write · …`) and the
  tool's arguments, so commands and file changes ask as such and
  auto-accept-edits accepts edits.
- It offers `allow_always`, which Goose writes to its machine-wide
  `permission.yaml`; only the once options are offered.
- Tool calls name their extension in `_meta`, which gives the session's
  MCP servers and the item type; Goose's own extensions are not MCP.
- Sign-in reads the provider and model `goose info -v` resolves, without
  a model call, and tells a pressly/goose binary apart.

Closes sandbox-quantum#780
Register goose in switch-buddy telemetry types, document the user-input
skip for ACP form elicitation, and add a known-limits row for Goose 1.57.0.
Extend management and switch-buddy template tests for the Goose registry
entry and advanced-config schema.
Runs interrupt, mcp-registered, subagent, and steer-mid-turn with 65s
spacing, then the full goose integration file.
Note spaced-scenario runs on Amazon Linux 2023 and the user-input skip.
The remaining-scenarios script now runs each conformance case in isolation
with 65s gaps instead of a final back-to-back vitest file run, which exhausts
Gemini free-tier quotas. Ruff-format the goose provider list assertion.
No other provider ships one. The PR description records how the
scenarios were run one at a time to stay within free-tier limits.

@petr-sandbox petr-sandbox left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good.

@petr-sandbox
petr-sandbox merged commit 055afd9 into sandbox-quantum:main Nov 11, 2026
18 of 19 checks passed
simonflk-sb added a commit that referenced this pull request Nov 11, 2026
#1504 added Kiro and #1439 added Goose as providers, so 'none is ready'
needs them signed out as well; otherwise the page waits on them and offers
no buttons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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