Skip to content

Expose GOOSE_SESSION_ID environment variable in CLI sessions #6308

@clouatre

Description

@clouatre

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:

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions