-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: per-message thumbs up/down feedback #9718
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
Open
lambertjosh
wants to merge
2
commits into
main
Choose a base branch
from
feature/message-feedback
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+546
−57
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "kilo-code": minor | ||
| "@kilocode/cli": minor | ||
| --- | ||
|
|
||
| Rate assistant responses with thumbs up/down. Click the thumbs buttons next to the copy button on any assistant message, or press `<leader>=` / `<leader>-` in the terminal UI. Only shown when telemetry is enabled; feedback is sent to Kilo to help improve model and prompt quality. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export { TelemetryEventName, type TelemetryPropertiesProvider } from "./types" | ||
| export { TelemetryProxy } from "./telemetry-proxy" | ||
| export { pushTelemetryState } from "./webview-state" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import * as vscode from "vscode" | ||
|
|
||
| /** | ||
| * Push the current VS Code telemetry-enabled flag to a webview. Called on | ||
| * webview ready / re-sync so the webview can gate feedback UI on the flag. | ||
| */ | ||
| export function pushTelemetryState(post: (msg: { type: "telemetryState"; enabled: boolean }) => void): void { | ||
| post({ type: "telemetryState", enabled: vscode.env.isTelemetryEnabled }) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import { describe, it, expect } from "bun:test" | ||
| import { buildFeedbackProperties, isKiloGateway } from "../../webview-ui/src/context/feedback-payload" | ||
|
|
||
| const baseInput = { | ||
| messageID: "msg_abc", | ||
| sessionID: "ses_xyz", | ||
| parentMessageID: "msg_parent", | ||
| modelID: "claude-sonnet-4-5", | ||
| variant: undefined as string | undefined, | ||
| } | ||
|
|
||
| describe("isKiloGateway", () => { | ||
| it("matches the canonical kilo provider", () => { | ||
| expect(isKiloGateway("kilo")).toBe(true) | ||
| }) | ||
|
|
||
| it("matches aliased kilo providers", () => { | ||
| expect(isKiloGateway("kilo-dev")).toBe(true) | ||
| expect(isKiloGateway("kilocloud")).toBe(true) | ||
| }) | ||
|
|
||
| it("does not match direct providers", () => { | ||
| expect(isKiloGateway("anthropic")).toBe(false) | ||
| expect(isKiloGateway("openai")).toBe(false) | ||
| expect(isKiloGateway("openrouter")).toBe(false) | ||
| }) | ||
| }) | ||
|
|
||
| describe("buildFeedbackProperties — non-Kilo providers", () => { | ||
| it("includes only provider/model/rating (no session or message IDs)", () => { | ||
| const props = buildFeedbackProperties({ ...baseInput, providerID: "anthropic", next: "up" }) | ||
| expect(props).toEqual({ | ||
| providerID: "anthropic", | ||
| modelID: "claude-sonnet-4-5", | ||
| rating: "up", | ||
| }) | ||
| expect(props).not.toHaveProperty("sessionID") | ||
| expect(props).not.toHaveProperty("messageID") | ||
| expect(props).not.toHaveProperty("parentMessageID") | ||
| }) | ||
|
|
||
| it("includes variant when set", () => { | ||
| const props = buildFeedbackProperties({ ...baseInput, providerID: "openai", variant: "preview", next: "down" }) | ||
| expect(props.variant).toBe("preview") | ||
| }) | ||
|
|
||
| it("includes previousRating when provided", () => { | ||
| const props = buildFeedbackProperties({ ...baseInput, providerID: "anthropic", next: "down" }, "up") | ||
| expect(props.previousRating).toBe("up") | ||
| }) | ||
|
|
||
| it("uses 'cleared' when next is null", () => { | ||
| const props = buildFeedbackProperties({ ...baseInput, providerID: "anthropic", next: null }, "up") | ||
| expect(props.rating).toBe("cleared") | ||
| expect(props.previousRating).toBe("up") | ||
| }) | ||
| }) | ||
|
|
||
| describe("buildFeedbackProperties — Kilo Gateway", () => { | ||
| it("includes sessionID, messageID, parentMessageID", () => { | ||
| const props = buildFeedbackProperties({ ...baseInput, providerID: "kilo", next: "up" }) | ||
| expect(props).toEqual({ | ||
| providerID: "kilo", | ||
| modelID: "claude-sonnet-4-5", | ||
| rating: "up", | ||
| sessionID: "ses_xyz", | ||
| messageID: "msg_abc", | ||
| parentMessageID: "msg_parent", | ||
| }) | ||
| }) | ||
|
|
||
| it("treats aliased kilo providers the same", () => { | ||
| const props = buildFeedbackProperties({ ...baseInput, providerID: "kilo-cloud", next: "up" }) | ||
| expect(props.sessionID).toBe("ses_xyz") | ||
| expect(props.messageID).toBe("msg_abc") | ||
| expect(props.parentMessageID).toBe("msg_parent") | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
WARNING: Telemetry opt-out changes do not reach an open webview
pushTelemetryStateonly runs during webview sync, and there is novscode.env.onDidChangeTelemetryEnabledsubscription. If the user disables telemetry while the sidebar is already open,feedback.telemetryEnabled()remains true, so the buttons stay visible andfeedbackSubmittedcan still persist a rating until the webview reloads. Wire the telemetry change event to posttelemetryStateand dispose that listener with the other webview disposables.