Skip to content

feat: per-message thumbs up/down feedback#9718

Open
lambertjosh wants to merge 1 commit intomainfrom
feature/message-feedback
Open

feat: per-message thumbs up/down feedback#9718
lambertjosh wants to merge 1 commit intomainfrom
feature/message-feedback

Conversation

@lambertjosh
Copy link
Copy Markdown
Contributor

@lambertjosh lambertjosh commented Apr 30, 2026

Summary

Lets users thumbs-up / thumbs-down any assistant response so we can learn which answers land. Feedback is sent through the existing PostHog telemetry pipeline — no new infrastructure, no PostHog changes required.

  • VS Code: thumbs buttons live next to the existing copy button on each assistant message.
  • TUI: two new keybinds messages_feedback_up / messages_feedback_down bound by default to <leader>+ / <leader>-, operating on the last assistant message.
  • Gated on telemetry. VS Code hides the buttons entirely when vscode.env.isTelemetryEnabled is false. TUI shows a brief toast and is a no-op when Telemetry.isEnabled() is false.

Payload

Deliberately different by provider — we only collect correlatable IDs when they help improve the product.

  • Non-Kilo-Gateway (Anthropic, OpenAI, etc.): providerID, modelID, variant?, rating, previousRating?. No session or message IDs.
  • Kilo Gateway (providerID.startsWith("kilo")): same fields plus sessionID, messageID, parentMessageID (= the x-kilo-request header value).

Event name: Feedback Submitted. Added once to each enum (TelemetryEvent in kilo-telemetry, TelemetryEventName in kilo-vscode).

State

In-memory only. Ratings reset on webview reload and TUI session switch. Persistence was intentionally descoped to keep the first pass simple — it can be added later without changing the telemetry contract or payload shape.

Tests

Unit tests cover payload shaping for both provider variants. End-to-end verified against a local bun dev serve backend — both payloads accepted with HTTP 200.

Related

@lambertjosh lambertjosh marked this pull request as draft April 30, 2026 01:47
messages_undo: keybind("<leader>u", "Undo message"),
messages_redo: keybind("<leader>r", "Redo message"),
// kilocode_change start - message feedback
messages_feedback_up: keybind("<leader>+", "Rate last assistant message helpful"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: <leader>+ cannot be parsed as a literal plus key

Keybind.parse replaces <leader> with leader+ and then splits the combo on +, so this default becomes leader++ and records an empty key name instead of +. The thumbs-up keybind will not fire in the TUI unless the parser learns how to encode a literal plus key or this default uses a parseable binding.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 30, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/src/KiloProvider.ts 354 Telemetry opt-out changes are only pushed on webview sync, so an already-open webview can keep feedback controls enabled after consent is revoked.
packages/opencode/src/config/keybinds.ts 55 <leader>+ is parsed as an empty key name, so the TUI thumbs-up keybind will not fire.

Fix these issues in Kilo Cloud

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
None
Files Reviewed (2 files)
  • .kilo/plans/1777465813459-misty-sailor.md - deleted, no issues
  • packages/kilo-ui/src/components/message-part.tsx - 0 issues

Carried forward unresolved findings from unchanged files:

  • packages/kilo-vscode/src/KiloProvider.ts - 1 issue
  • packages/opencode/src/config/keybinds.ts - 1 issue

Reviewed by gpt-5.5-2026-04-23 · 914,993 tokens

@lambertjosh lambertjosh force-pushed the feature/message-feedback branch from a7cf6ff to 43c41d1 Compare May 1, 2026 18:13
@lambertjosh lambertjosh marked this pull request as ready for review May 1, 2026 20:52
state: this.connectionState,
})
this.postMessage({ type: "connectionState", state: this.connectionState })
pushTelemetryState((m) => this.postMessage(m))
Copy link
Copy Markdown
Contributor

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

pushTelemetryState only runs during webview sync, and there is no vscode.env.onDidChangeTelemetryEnabled subscription. If the user disables telemetry while the sidebar is already open, feedback.telemetryEnabled() remains true, so the buttons stay visible and feedbackSubmitted can still persist a rating until the webview reloads. Wire the telemetry change event to post telemetryState and dispose that listener with the other webview disposables.

@lambertjosh lambertjosh force-pushed the feature/message-feedback branch from 43c41d1 to bf3c31b Compare May 1, 2026 21:40
Adds thumbs up/down buttons next to the copy button on every assistant
message in the VS Code sidebar, and <leader>+/<leader>- keybinds in the
TUI. UI state is in-memory only — ratings reset on reload / session
switch. Persistence can be added later without changing the telemetry
contract.

Events are sent to PostHog via the existing telemetry pipeline. For
Kilo Gateway turns the payload includes session and message IDs so
feedback can be correlated against gateway logs; for direct providers
those IDs are omitted since we cannot correlate them to upstream data.
@lambertjosh lambertjosh force-pushed the feature/message-feedback branch from bf3c31b to cdacd6f Compare May 1, 2026 22:15
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.

1 participant