Skip to content

Conversation

@wpfleger96
Copy link
Collaborator

@wpfleger96 wpfleger96 commented Oct 27, 2025

This PR fixes the --resume flag to correctly resume the most recent session when used without additional parameters, restoring functionality that I accidentally regressed in PR #5360

After PR #5360, using goose run --resume or goose session --resume without specifying a session name or ID would create a new session instead of resuming the last used session

Implementation details:

  • Modified get_or_create_session_id() function in crates/goose-cli/src/cli.rs to check the resume flag when no identifier is provided
  • When resume is true and no identifier given, fetches sessions via SessionManager::list_sessions() and resumes the first (most recent by updated_at)
  • When resume is false and no identifier given, creates a new session as before
  • Preserves all existing behavior for --name and --session-id parameters from PR fix: --session-id shouldn't work without --resume, but --name should #5360

Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as always, remove the comments if you want to make me happy

@wpfleger96 wpfleger96 merged commit c0032ef into main Oct 27, 2025
13 of 14 checks passed
@wpfleger96 wpfleger96 deleted the temp-fix-session-resume branch October 27, 2025 21:36
michaelneale added a commit that referenced this pull request Oct 28, 2025
* main:
  Feat/add mermaid chart rendering (#5377)
  Set up Datadog metrics for prompt injection detection (#5385)
  fix: restore --resume functionality for most recent session (#5401)
  Gemini again (#5390)
  docs(prompt-library): add github-issue-labeler intermediate prompt (#5374)
  docs: add Linux and Windows paths to uninstall section (#5371)
  fix: --session-id shouldn't work without --resume, but --name should (#5360)
  Auto-compact Threshold UI improvements (#5354)
  Filter preserved user messages to be text only. (#5391)
  include sessionId in tool request (#5394)
  feat: add PR Impact Analyzer prompt (#5375)
  docs: add blog post on configuring goose for team environments (#5380)
  migrating back with new chatrecall non underscore name (#5223)
katzdave added a commit that referenced this pull request Nov 3, 2025
* 'main' of github.com:block/goose: (132 commits)
  Fix/icon ii (#5413)
  Enable runtime access to provider name (#5399)
  fix: ensure trailing newline in files created by `text_editor` tool (#5336)
  docs: September 2025 Community All-Stars (#5411)
  make supports_cache_control async to avoid block in place (#5362)
  Send all the logs we output (#5363)
  Recipe variables (#5365)
  Feat/add mermaid chart rendering (#5377)
  Set up Datadog metrics for prompt injection detection (#5385)
  fix: restore --resume functionality for most recent session (#5401)
  Gemini again (#5390)
  docs(prompt-library): add github-issue-labeler intermediate prompt (#5374)
  docs: add Linux and Windows paths to uninstall section (#5371)
  fix: --session-id shouldn't work without --resume, but --name should (#5360)
  Auto-compact Threshold UI improvements (#5354)
  Filter preserved user messages to be text only. (#5391)
  include sessionId in tool request (#5394)
  feat: add PR Impact Analyzer prompt (#5375)
  docs: add blog post on configuring goose for team environments (#5380)
  migrating back with new chatrecall non underscore name (#5223)
  ...
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
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.

3 participants