-
Notifications
You must be signed in to change notification settings - Fork 123
Open
Labels
Description
Problem
Goose has native SQLite-based session persistence (~/.local/share/goose/sessions/sessions.db) and supports resuming named sessions via goose run --resume --name <name>. However, start.sh always starts a fresh session with no resume logic. It also doesn't pass --type goose to agentapi.
The module currently passes the task prompt via --instructions "$PROMPT_FILE". On resume, this must be skipped to avoid re-sending the task into an active conversation.
Desired outcome
- On cold start (no prior session): Goose creates a named session and processes the task prompt.
- On warm start (prior session exists): Goose resumes the named session. The task prompt (
--instructions) is not re-sent. --type gooseis passed toagentapi server.- After feat(coder/modules/agentapi): add state persistence #736 lands:
enable_state_persistence = true.
Claude Code's start.sh is the reference implementation for this pattern (session detection, conditional resume, prompt skipping).
Key upstream behaviors
goose run --resume --name Xwhen session X doesn't exist: Goose warns and creates a new session (block/goose#3904). This is a safe fallback.- The SQLite DB uses WAL mode, meaning
sessions.db-walandsessions.db-shmsidecar files must be on the same persistent volume. sqlite3CLI may not be installed in all workspace images. Session detection should not depend on it, or should degrade gracefully.- block/goose#6236 reported subprocess panics when resuming without a TTY. AgentAPI provides a PTY but this combination should be tested.
Version bump
minor
Refs #696
Reactions are currently unavailable