Skip to content

feat(agents): add goose adapter#129

Closed
yyovil wants to merge 1 commit into
agents/09-copilotfrom
agents/10-goose
Closed

feat(agents): add goose adapter#129
yyovil wants to merge 1 commit into
agents/09-copilotfrom
agents/10-goose

Conversation

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 6, 2026

Greptile Summary

This PR adds the Goose (Block) agent adapter: a new goose package with launch/restore command building, lifecycle hook installation, binary resolution, and an activity deriver, wired into the adapter registry and activity dispatcher.

  • New adapter package (goose/): implements adapters.Adapter and ports.Agent with GetLaunchCommand, GetRestoreCommand, SessionInfo, GetAgentHooks, UninstallHooks, and AreHooksInstalled; permission modes are forwarded via env GOOSE_MODE=<value> argv prefix.
  • Hook management (hooks.go): install/uninstall of workspace-local .agents/plugins/ao/hooks/hooks.json using the same idempotent matcher-group merge strategy as the codex adapter, but with a private atomicWriteFile that is missing the tmp.Sync() step present in hookutil.AtomicWriteFile.
  • Registry + dispatch wiring: goose.New() added to Constructors(), goose.DeriveActivityState added to activitydispatch.Derivers, and HarnessGoose added to the resolver integration test.

Confidence Score: 4/5

The adapter logic is sound and well-tested, but the hooks writer silently drops the fsync guarantee that the shared hookutil primitive was designed to enforce.

The private atomicWriteFile in hooks.go omits tmp.Sync() — a step that hookutil.AtomicWriteFile deliberately includes and that all other hook-writing adapters rely on. On a kernel crash between page-cache fill and physical flush, the hooks file can be lost, leaving Goose with no AO hook commands and making the session invisible to the activity dispatcher.

backend/internal/adapters/agent/goose/hooks.go — the local atomicWriteFile should be replaced with hookutil.AtomicWriteFile

Important Files Changed

Filename Overview
backend/internal/adapters/agent/goose/hooks.go Hook install/uninstall logic correct and well-tested; duplicates hookutil.AtomicWriteFile locally but omits the tmp.Sync() step present in the shared implementation
backend/internal/adapters/agent/goose/goose.go Core adapter: launch/restore command construction, binary resolution, and permission-mode mapping all look correct and well-documented
backend/internal/adapters/agent/goose/activity.go Event-to-activity-state deriver is clean; the documented-but-uninstalled permission-request case is intentional and well-commented
backend/internal/adapters/agent/goose/goose_test.go Comprehensive test coverage across all public methods, context cancellation, permission modes, and hook lifecycle
backend/internal/adapters/agent/activitydispatch/dispatch.go Correctly registers goose deriver alongside all other adapters
backend/internal/adapters/agent/registry/registry.go Correctly adds goose.New() to Constructors()
backend/internal/daemon/wiring_test.go Adds HarnessGoose → "goose" resolver assertion to the existing wiring test table

Reviews (2): Last reviewed commit: "feat(agents): add goose adapter" | Re-trigger Greptile

Comment thread backend/internal/adapters/agent/goose/goose.go Outdated
Registers the goose harness, stacked on the agent platform. Includes its own activity deriver.

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

2 participants