feat: add Goose conversation adapter and workspace agent option#230
feat: add Goose conversation adapter and workspace agent option#230callmeradical wants to merge 1 commit intomarcus:mainfrom
Conversation
Add first-class Goose support across conversations and workspace flows. Adapter implementation (internal/adapter/goose): - Implement full adapter contract: Detect, Sessions, SessionByID, Messages, Usage, Watch - Register adapter via register.go and wire startup import in cmd/sidecar/main.go - Parse Goose SQLite schema (sessions.db / messages.content_json) into Sidecar message model - Map structured content blocks (text, thinking/reasoning, toolRequest/toolResponse) - Link tool_result blocks back to tool_use entries by ToolUseID parity - Add MessageSearcher support via SearchMessages() using shared adapter search utilities - Add TargetedRefresher support via SessionByID() for O(1) targeted refresh - Add bounded message cache (LRU-style eviction, max 128) with signature-based invalidation - Return defensive message copies from cache to prevent mutation leaks - Strictly fail on malformed message content_json parse errors - Populate Session.FileSize for DB-backed sessions using sessions.db + sessions.db-wal size - Optimize Sessions query to use LEFT JOIN + GROUP BY counts instead of correlated per-row subquery - Implement WAL-aware watcher with debounce + non-blocking sends and best-effort SessionID enrichment Workspace integration (internal/plugins/workspace): - Add new AgentType constant: goose - Add Goose display names/abbreviations, command mapping, and ordering in create/shell selectors - Keep skip-permissions unset for Goose (no known flag) - Extend agent command test coverage for Goose mapping Tests and benchmarks: - Add comprehensive adapter unit tests (detect/sessions/messages/usage/watch/search/session lookup) - Add cache safety tests (defensive copy + invalidation on append) - Add malformed-content error-path test - Add benchmark suite for cache-hit messages and session listing (including 50-session benchmark) Validation run: - go test ./internal/adapter/goose -run . - go test ./internal/adapter/goose -bench . -benchmem -run '^$' - go test ./internal/plugins/workspace -run '^TestGetAgentCommand$' - go build ./...
|
Hey @callmeradical! Starling here (AI assistant on the project). 👋 Wow — this is a seriously thorough Goose adapter implementation. The level of detail here is impressive:
2050+ lines of careful, well-structured work. Lars, thank you for investing this much into it. Flagging Marcus to take a proper look — Goose is a popular agent and this rounds out the adapter roster nicely. Will get back to you with review notes. ✦ |
|
Hey, just wanted to follow-up on this. Any chance of inclusion or any feedback for changes? |
|
Thanks for the follow up, looking now! |
|
Thanks for putting this together. I did a deep review and I don’t think we should merge this yet. Once the issues below are addressed, we’ll merge. Main blockers:
Also, What I verified:
Once the pathing, watch/refresh isolation, |
|
@marcus thanks for the look, will update and resubmit. |
Add Goose support across conversations and workspace flows.
Adapter implementation (internal/adapter/goose):
Workspace integration (internal/plugins/workspace):
Tests and benchmarks:
Validation run: