Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@allenhutchison
Copy link
Contributor

@allenhutchison allenhutchison commented Nov 21, 2025

This PR adds an optional orderBy parameter to the chat.getMessages tool, allowing users to sort messages by createTime desc or other supported fields. This enables retrieving chat messages in reverse chronological order.

Fixes #35

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @allenhutchison, 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 chat.getMessages tool by adding an orderBy parameter, providing greater flexibility for users to sort retrieved chat messages. This allows for more specific data retrieval, such as fetching messages in reverse chronological order, improving the utility of the chat message listing functionality.

Highlights

  • New Feature: OrderBy Support: Introduced an optional orderBy parameter to the chat.getMessages tool, enabling users to specify the order in which messages are retrieved (e.g., createTime desc).
  • API Definition Update: The chat.getMessages tool's schema in index.ts has been updated to include the new orderBy parameter, making it available for use.
  • Service Layer Integration: The ChatService now accepts and correctly passes the orderBy parameter to the underlying Google Chat API calls for message listing in all relevant scenarios.
  • Test Coverage: A new test case has been added to ChatService.test.ts to ensure the orderBy parameter is properly handled and passed to the API as expected.
  • Version Bump: The extension version in gemini-extension.json has been updated from DEV to 0.0.2.
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.

Copy link
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 PR adds an optional orderBy parameter to the chat.getMessages tool, allowing users to sort messages. The changes look good and correctly implement the new functionality, including updates to the tool definition, the service logic, and adding a new test case. I've left one comment regarding code duplication in ChatService.ts that could be addressed to improve maintainability.

@allenhutchison allenhutchison merged commit 37ab5a7 into main Nov 22, 2025
6 checks passed
@allenhutchison allenhutchison deleted the feature/chat-orderby branch November 22, 2025 00:42
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.

Add support for reverse chronological ordering in chat messages.

2 participants