-
Notifications
You must be signed in to change notification settings - Fork 9.2k
feat: Implement /thanks command with telemetry for positive feedback #12873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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.
|
@adamfweidman I created a commit for /thanks command. |
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>
This commit introduces the new
/thanksslash command, allowing users to provide positive feedback on the AI's responses.Key changes include:
thanksCommand.tsto handle the/thankscommand, displaying a local UI message and logging telemetry.UserPositiveFeedbackEventandEVENT_USER_POSITIVE_FEEDBACKinpackages/core/src/telemetry/types.ts.logUserPositiveFeedbackfunction topackages/core/src/telemetry/loggers.tsto emit this event via OpenTelemetry and Clearcut.ClearcutLoggerto includelogUserPositiveFeedbackEventandEventNames.USER_POSITIVE_FEEDBACK.packages/core/index.ts.BuiltinCommandLoader.tsto register the new/thankscommand.CommandContextinpackages/cli/src/ui/commands/types.tsto includesession.lastGeminiResponsePromptIdfor tracking the response receiving feedback.packages/cli/src/nonInteractiveCliCommands.tsrelated toCommandContextstructure.packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts.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.