Skip to content

Conversation

@kairosci
Copy link

@kairosci kairosci commented Nov 11, 2025

This commit introduces the new /thanks slash command, allowing users to provide positive feedback on the AI's responses.

Key changes include:

  • Added thanksCommand.ts to handle the /thanks command, displaying a local UI message and logging telemetry.
  • Integrated telemetry for positive user feedback:
    • Defined UserPositiveFeedbackEvent and EVENT_USER_POSITIVE_FEEDBACK in packages/core/src/telemetry/types.ts.
    • Added logUserPositiveFeedback function to packages/core/src/telemetry/loggers.ts to emit this event via OpenTelemetry and Clearcut.
    • Updated ClearcutLogger to include logUserPositiveFeedbackEvent and EventNames.USER_POSITIVE_FEEDBACK.
    • Exported new telemetry functions and types from packages/core/index.ts.
  • Modified BuiltinCommandLoader.ts to register the new /thanks command.
  • Updated CommandContext in packages/cli/src/ui/commands/types.ts to include session.lastGeminiResponsePromptId for tracking the response receiving feedback.
  • Fixed a type casting issue in packages/cli/src/nonInteractiveCliCommands.ts related to CommandContext structure.
  • Corrected a syntax error in packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts.
  • Removed a duplicate enum entry in packages/core/src/telemetry/clearcut-logger/event-metadata-key.ts.

This implementation ensures that positive user feedback is captured and tracked, fulfilling the requirement for functional feedback beyond just UI.

  • 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

This commit introduces the new `/thanks` slash command, allowing users to
provide positive feedback on the AI's responses.

Key changes include:
- Added `thanksCommand.ts` to handle the `/thanks` command, displaying a local
  UI message and logging telemetry.
- Integrated telemetry for positive user feedback:
  - Defined `UserPositiveFeedbackEvent` and `EVENT_USER_POSITIVE_FEEDBACK` in
    `packages/core/src/telemetry/types.ts`.
  - Added `logUserPositiveFeedback` function to `packages/core/src/telemetry/loggers.ts`
    to emit this event via OpenTelemetry and Clearcut.
  - Updated `ClearcutLogger` to include `logUserPositiveFeedbackEvent` and
    `EventNames.USER_POSITIVE_FEEDBACK`.
  - Exported new telemetry functions and types from `packages/core/index.ts`.
- Modified `BuiltinCommandLoader.ts` to register the new `/thanks` command.
- Updated `CommandContext` in `packages/cli/src/ui/commands/types.ts` to
  include `session.lastGeminiResponsePromptId` for tracking the response
  receiving feedback.
- Fixed a type casting issue in `packages/cli/src/nonInteractiveCliCommands.ts`
  related to `CommandContext` structure.
- Corrected a syntax error in `packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts`.
- Removed a duplicate enum entry in `packages/core/src/telemetry/clearcut-logger/event-metadata-key.ts`.

This implementation ensures that positive user feedback is captured and
tracked, fulfilling the requirement for functional feedback beyond just UI.
@kairosci kairosci requested review from a team as code owners November 11, 2025 10:16
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kairosci, 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 focuses on enhancing user interaction by introducing a new /thanks command, allowing users to express positive sentiment towards AI responses. The core functionality includes robust telemetry integration to capture this valuable feedback, providing insights into user satisfaction. Additionally, the changes involve necessary updates to the command system's context to facilitate feedback tracking and minor dependency adjustments for overall system health.

Highlights

  • New /thanks Command: Introduced a new /thanks slash command that allows users to provide positive feedback on the AI's responses. This command displays a local UI message and is hidden from the general /help list.
  • Positive Feedback Telemetry: Implemented a new UserPositiveFeedbackEvent and associated logging functions to capture and track positive user feedback via OpenTelemetry and Clearcut. This telemetry includes the prompt_id of the AI response being thanked.
  • Command Context Enhancement: Updated the CommandContext to include session.lastGeminiResponsePromptId, which stores the ID of the last AI response, enabling the /thanks command to associate feedback with a specific interaction.
  • Dependency Management Adjustments: Modified package-lock.json to adjust peer dependency flags for various packages, including OpenTelemetry components, React, TypeScript, and others, streamlining dependency resolution.
  • Minor Fixes and Exports: Addressed a type casting issue in nonInteractiveCliCommands.ts and ensured new telemetry functions and types are properly exported from the core package.
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 pull request introduces a new /thanks command, allowing users to provide positive feedback on AI responses. The implementation includes adding the thanksCommand.ts, integrating new telemetry events for positive feedback (UserPositiveFeedbackEvent), and updating the ClearcutLogger and other services to handle this new event.

The changes are well-structured. However, I've identified a high-severity issue in the thanksCommand.ts implementation where the user receives a success message even if the feedback cannot be logged (e.g., when there's no previous AI response). I've provided a suggestion to fix this by checking preconditions first and providing accurate feedback to the user.

@kairosci
Copy link
Author

@adamfweidman I created a commit for /thanks command.

kairosci and others added 11 commits November 11, 2025 11:30
This commit refines the user feedback mechanism for the `/thanks` slash command.
Previously, the command would always display "Feedback received" even if there
was no recent AI response to associate the feedback with, potentially misleading
the user.

This change introduces a validation step:
- If `context.session.lastGeminiResponsePromptId` is missing (meaning no recent
  AI response is available), the command now informs the user with the message:
  "There is no recent AI response to give feedback on."
- Otherwise, it proceeds with the original flow: displaying "Feedback received.
  Thank you!" and logging the positive feedback telemetry.

This ensures that the user receives accurate feedback regarding the status of
their `/thanks` command, improving the overall user experience.
…ransport crea… (google-gemini#12849)

Co-authored-by: David McWherter <davidmcw@gmail.com>
…ion management (google-gemini#10719)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: owenofbrien <86964623+owenofbrien@users.noreply.github.com>
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.

10 participants