Skip to content

feat(ui): include session ID in the exit message's footer#20875

Closed
devr0306 wants to merge 7 commits intomainfrom
resume-session-message
Closed

feat(ui): include session ID in the exit message's footer#20875
devr0306 wants to merge 7 commits intomainfrom
resume-session-message

Conversation

@devr0306
Copy link
Copy Markdown
Contributor

@devr0306 devr0306 commented Mar 2, 2026

Summary

Added session ID to the tip at the end of the exit message.

Details

Updated the summary file and the corresponding snapshot. Also sanitized the session ID before passing it into the footer to prevent command injection.

Related Issues

Closes #19379

How to Validate

Run Gemini CLI and exit it, the exit message should say the following at the bottom:

To resume this session, run:
gemini --resume <sessionId>

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@devr0306 devr0306 requested a review from a team as a code owner March 2, 2026 19:36
@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 enhances the user experience of the CLI by modifying the exit message to include a clear, actionable command for resuming the current session. By displaying the session ID directly in the footer, users can easily pick up where they left off, improving workflow continuity.

Highlights

  • Feature Enhancement: Implemented the inclusion of the session ID in the exit message's footer, providing users with a direct command to resume their session.
  • Code Refactoring: Modified the SessionSummaryDisplay component to utilize the useSessionStats hook, allowing dynamic retrieval of session-specific data.
  • Testing: Updated the corresponding snapshot test to reflect the new format of the exit message, ensuring consistency and correctness.
Changelog
  • packages/cli/src/ui/components/SessionSummaryDisplay.tsx
    • Imported useSessionStats from ../contexts/SessionContext.js.
    • Converted the functional component to use a block body to incorporate logic.
    • Called useSessionStats() to retrieve session statistics.
    • Constructed a dynamic footer string that includes the sessionId for session resumption.
  • packages/cli/src/ui/components/snapshots/SessionSummaryDisplay.test.tsx.snap
    • Updated the snapshot to reflect the new exit message format, which now includes the 'To resume this session, run: gemini --resume test-session' text.
Activity
  • The author has validated the changes on MacOS using npm run.
  • Relevant tests have been added or updated to cover the changes.
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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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
Copy link
Copy Markdown

github-actions bot commented Mar 2, 2026

Size Change: +168 B (0%)

Total Size: 25.8 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 25.3 MB +168 B (0%)
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

Copy link
Copy Markdown
Contributor

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

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 exit message to include the specific session ID, making it easier for users to resume their session. However, it introduces a potential command injection vulnerability by including the session ID in a suggested shell command without proper sanitization. If a user resumes a malicious session and copies the suggested command, it could lead to arbitrary code execution. Additionally, the hardcoded gemini command might not work for all users, depending on their CLI invocation method, potentially causing confusion. It is recommended to sanitize or properly quote the session ID and consider making the resume command suggestion more generic.

@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Mar 2, 2026
@devr0306
Copy link
Copy Markdown
Contributor Author

devr0306 commented Mar 4, 2026

Closing as this got addressed by #20667

@devr0306 devr0306 closed this Mar 4, 2026
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 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On exit show a message explaining to users exactly how to resume their session

2 participants