Skip to content

fix(cli): resolve resume latest to most recently active session - #29411

Closed
soroush5 wants to merge 1 commit into
google-gemini:mainfrom
soroush5:fix/resume-latest-most-recently-active
Closed

soroush5 wants to merge 1 commit into
google-gemini:mainfrom
soroush5:fix/resume-latest-most-recently-active

Conversation

@soroush5

Copy link
Copy Markdown

Bare --resume picked the session with the newest start time, so users with a long-lived main session plus a newer spike resumed into the stale spike. Latest now resolves by most recent activity.

Verified: new test fails before and passes after, neighbors green.

Fixes #29410

Bare --resume (and --resume latest) picked the most recently started
session by startTime, so returning to an earlier session and later
resuming reopened a stale one instead of the session just left.
Select by lastUpdated, which the recorder updates on every turn.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the behavior of the '--resume' flag in the CLI. Previously, the system would resume the session with the most recent start time, which often led to users incorrectly resuming stale 'spike' sessions instead of their primary, active session. The logic has been updated to correctly identify the most recently active session, ensuring a more intuitive experience.

Highlights

  • Session Resolution Logic: Updated the 'latest' session resolution logic to prioritize the most recently active session based on 'lastUpdated' rather than the session start time.
  • Test Coverage: Added a new test case to verify that a long-lived session with recent activity is correctly preferred over a newer, stale session.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions github-actions Bot added the size/m A medium sized PR label Sep 19, 2026
@github-actions

Copy link
Copy Markdown

📊 PR Size: size/M

  • Lines changed: 79
  • Additions: +73
  • Deletions: -6
  • Files changed: 2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the session resolution logic in packages/cli/src/utils/sessionUtils.ts to determine the 'latest' session based on the most recent activity (lastUpdated) rather than the session start time (startTime). It also adds a corresponding unit test in packages/cli/src/utils/sessionUtils.test.ts to verify this behavior. There are no review comments, and I have no feedback to provide.

@gemini-cli gemini-cli Bot added priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality labels Sep 19, 2026
@gemini-cli

gemini-cli Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Hi there! Thank you for your interest in contributing to Gemini CLI.

To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'.

This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding.

@gemini-cli

gemini-cli Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality priority/p2 Important but can be addressed in a future release. size/m A medium sized PR status/pr-nudge-sent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resume latest reopens most recently started session, not most recently used

1 participant