-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Please explain the motivation behind the feature request.
goose term init sets GOOSE_SESSION_ID for shell integration, but normal CLI sessions (goose, goose run --recipe) do not. This forces recipe authors to generate their own IDs that don't align with Goose's internal session tracking.
Use cases:
- Session-isolated handoff paths (
.goose/$GOOSE_SESSION_ID/handoff/) - Worktree isolation per session (related to Support git worktrees so multiple geese can work independently in git directories #3557)
- Debug correlation between artifacts and session history
Describe the solution you'd like
In crates/goose-cli/src/session/builder.rs, after session creation:
std::env::set_var("GOOSE_SESSION_ID", &session_id);Subagents inherit parent's ID via environment (for correlation).
Describe alternatives you've considered
- Generate timestamp-based IDs in recipes - works but misaligned with internal IDs
- Query SQLite directly - fragile
Additional context
-
Precedent:
GOOSE_TERMINAL=1,GOOSE_SUBAGENT_MAX_TURNSalready exposed -
Related: Use session IDs as task IDs for subagents instead of UUIDs #4955 (session IDs as task IDs), Support git worktrees so multiple geese can work independently in git directories #3557 (worktree support), feat: Add max_turns to recipe and subagent settings #6198 (recipe settings portability)
-
Session ID format (
YYYYMMDD_N) contains no sensitive data -
I have verified this does not duplicate an existing feature request