Skip to content

feat(desktop): add opt-in feedback for conversations and replies - #5150

Open
Grapedge wants to merge 9 commits into
mainfrom
desktop-feedback
Open

Grapedge wants to merge 9 commits into
mainfrom
desktop-feedback

Conversation

@Grapedge

@Grapedge Grapedge commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

桌面应用和 kimi web 的用户遇到问题时,可以从侧栏或输入框里的 /feedback 提交反馈,也可以直接评价一条回复。两种入口都允许用户选择是否附带会话记录。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

反馈由 KAP(Kimi Agent Protocol)先保存正文或评价并返回编号。客户端拿到编号后才提交用户选择的附件,因此可以单独重试失败项。设置 KIMI_CODE_EXPERIMENTAL_DESKTOP_FEEDBACK=1 后可使用这些入口。

flowchart LR
    UI["桌面 / Web 表单"] -->|正文或回复评价| KAP["KAP 反馈接口"]
    KAP -->|反馈编号| UI
    UI -->|选中的文件或会话| KAP
    KAP -->|分片传输| Storage["附件存储"]
Loading

从 useDesktopFeedback.ts 看入口、撤销与附件提交授权,从 KAP 的 routes/feedback.ts 看提交、更新、提交附件和准备远程会话归档的五条路由。conversationFeed.ts 按回复匹配当时记录的模型和请求。服务端、客户端和两个界面放在同一个 PR,便于从正常入口验证整条提交链路。

Screenshots / Recordings

全局表单和单条回复表单中,提交会话记录的选项默认关闭。

全局反馈 单条回复反馈
全局反馈表单 单条回复评价

Behavior Changes and Affected Users

行为 之前 之后 影响人群 控制方式
反馈入口 侧栏与消息输入框没有这两个入口 开启后可提交问题、建议和其他反馈;关闭表单可保留草稿。全局「了解更多」和单条回复的帮助链接按界面语言打开反馈指南 桌面、Web 用户 实验开关默认关闭
评价回复 回复下方没有评分操作 可赞、踩或撤销。点踩后可选原因、补充说明,成功后可复制反馈编号。说明超过 2,000 字时暂停提交,离开输入框显示单行预览,点回后可继续编辑全文 已登录的桌面、Web 用户 再次点击可撤销
附件 这两个界面没有提交附件的入口 可选图片、视频和当前会话;桌面还可选择运行日志。勾选后显示勾号,键盘操作时保留焦点外圈。提交回执和附件提示随主题调整底色,附件提交失败可单独重试 主动提交反馈的用户 会话与日志默认均不勾选
旧会话与 API 旧日志可能缺少逐步模型或请求信息 读取已有记录时只关联可确认的信息;KAP 增加五条反馈路由 恢复历史会话的用户、旧 KAP 客户端 旧客户端可继续使用 API level 1
SSH 主机会话 没有回复评价和会话记录提交入口 回复评价取决于所属主机的开关。全局反馈由本机提交。勾选远程会话后,本机分段取回会话归档并附到原反馈,诊断日志单独授权 SSH 主机会话用户 可按主机分别启用
分片传输 CLI 已支持提交反馈附件 桌面和 Web 复用这条路径,支持取消,校验分片与文件大小 通过 CLI、桌面及 Web 提交附件的用户 CLI 保留既有入口

本地验证覆盖了表单提交、撤销、草稿、提交附件前的同意、失败重试和历史会话还原。附件可以在慢速连接上持续传输,直至完成或取消。对五条新增路由之外的 KAP 契约重新计算摘要,结果与基线一致。附件测试使用本地服务和示例数据。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue. 此功能没有关联的公开 issue。
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T08:22:39.548840Z db0dd39 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db0dd39

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
kimi-code-app Minor
@moonshot-ai/agent-core-v2 Minor
@moonshot-ai/kap-server Minor
@moonshot-ai/kimi-code-oauth Minor
@moonshot-ai/kimi-code Minor
@moonshot-ai/acp-server Patch
@moonshot-ai/klient Patch
@moonshot-ai/migration-legacy Patch
@moonshot-ai/kimi-code-product Patch
@moonshot-ai/remote-control Patch
kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@506e77b
npx https://pkg.pr.new/@moonshot-ai/kimi-code@506e77b

commit: 506e77b

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d40d8c4094

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/desktop/src/renderer/App.vue Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 193d6cd299

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/app-client/src/stores/hosts.ts Resolved
@github-actions

Copy link
Copy Markdown
Contributor

❌ Nix build failed

    kimi-code> [plugin vite:resolve] Module "node:fs" has been externalized for browser compatibility, imported by "/build/source/node_modules/.pnpm/@anthropic-ai+sdk@0.95.2_zod@4.3.6/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
    kimi-code> [plugin vite:resolve] Module "fs" has been externalized for browser compatibility, imported by "/build/source/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
    kimi-code> [plugin vite:resolve] Module "stream" has been externalized for browser compatibility, imported by "/build/source/node_modules/.pnpm/socks@2.8.9/node_modules/socks/build/common/helpers.js". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
    kimi-code> [plugin vite:resolve] Module "net" has been externalized for browser compatibility, imported by "/build/source/node_modules/.pnpm/socks@2.8.9/node_modules/socks/build/common/helpers.js". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
    kimi-code> [plugin vite:resolve] Module "node:fs" has been externalized for browser compatibility, imported by "/build/source/packages/minidb/src/worker-runtime.ts". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
    kimi-code> [plugin vite:resolve] Module "node:path" has been externalized for browser compatibility, imported by "/build/source/packages/minidb/src/worker-runtime.ts". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
    kimi-code> [plugin vite:resolve] Module "node:url" has been externalized for browser compatibility, imported by "/build/source/packages/minidb/src/worker-runtime.ts". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
    kimi-code> ../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts (63:30): "win32" is not exported by "__vite-browser-external", imported by "../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts".
    kimi-code> ../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts (64:33): "win32" is not exported by "__vite-browser-external", imported by "../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts".
    kimi-code> ../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts (65:17): "win32" is not exported by "__vite-browser-external", imported by "../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts".
    kimi-code> ../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts (66:31): "win32" is not exported by "__vite-browser-external", imported by "../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts".
    kimi-code> ../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts (97:34): "posix" is not exported by "__vite-browser-external", imported by "../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts".
    kimi-code> ../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts (139:32): "posix" is not exported by "__vite-browser-external", imported by "../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts".
    kimi-code> ✓ 8296 modules transformed.
    kimi-code> ✗ Build failed in 19.31s
    kimi-code> error during build:
    kimi-code> ../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts (1:9): "execFileSync" is not exported by "__vite-browser-external", imported by "../../packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts".
    kimi-code> file: /build/source/packages/agent-core-v2/src/_base/execEnv/shellPathBridge.ts:1:9
    kimi-code> 
    kimi-code> 1: import { execFileSync as nodeExecFileSync } from 'node:child_process';
    kimi-code>             ^
    kimi-code> 2: import { existsSync } from 'node:fs';
    kimi-code> 3: import * as nodePath from 'node:path';
    kimi-code> 
    kimi-code>     at getRollupError (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/parseAst.js:406:41)
    kimi-code>     at error (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/parseAst.js:402:42)
    kimi-code>     at Module.error (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:17384:16)
    kimi-code>     at Module.traceVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:17817:29)
    kimi-code>     at ModuleScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:15407:39)
    kimi-code>     at FunctionScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5676:38)
    kimi-code>     at FunctionBodyScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5676:38)
    kimi-code>     at ReturnValueScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5676:38)
    kimi-code>     at FunctionBodyScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5676:38)
    kimi-code>     at Identifier.bind (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5450:40)
    kimi-code> /build/source/apps/desktop:
    kimi-code>  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  kimi-code-app@1.3.7 build:web: `vite build --config vite.web.config.ts`
    kimi-code> Exit status 1
    kimi-code> file:///build/source/apps/kimi-code/scripts/sync-web-dist.mjs:19
    kimi-code>   throw new Error(`desktop web-variant build failed (exit ${String(build.status)})`);
    kimi-code>         ^
    kimi-code> 
    kimi-code> Error: desktop web-variant build failed (exit 1)
    kimi-code>     at file:///build/source/apps/kimi-code/scripts/sync-web-dist.mjs:19:9
    kimi-code>     at ModuleJob.run (node:internal/modules/esm/module_job:561:25)
    kimi-code>     at async node:internal/modules/esm/loader:647:26
    kimi-code>     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
    kimi-code> 
    kimi-code> Node.js v24.21.0
    error: Cannot build '/nix/store/2hlnxlg35awk53r52d21a6iiyjwc26qh-kimi-code-2.6.3.drv'.
           Reason: builder failed with exit code 1.
           Output paths:
             /nix/store/678xcmfm3srdjyzyilchzr9fzpyx5z59-kimi-code-2.6.3
           Last 25 log lines:
           > 
           >     at getRollupError (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/parseAst.js:406:41)
           >     at error (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/parseAst.js:402:42)
           >     at Module.error (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:17384:16)
           >     at Module.traceVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:17817:29)
           >     at ModuleScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:15407:39)
           >     at FunctionScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5676:38)
           >     at FunctionBodyScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5676:38)
           >     at ReturnValueScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5676:38)
           >     at FunctionBodyScope.findVariable (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5676:38)
           >     at Identifier.bind (file:///build/source/node_modules/.pnpm/rollup@4.60.2/node_modules/rollup/dist/es/shared/node-entry.js:5450:40)
           > /build/source/apps/desktop:
           >  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  kimi-code-app@1.3.7 build:web: `vite build --config vite.web.config.ts`
           > Exit status 1
           > file:///build/source/apps/kimi-code/scripts/sync-web-dist.mjs:19
           >   throw new Error(`desktop web-variant build failed (exit ${String(build.status)})`);
           >         ^
           >
           > Error: desktop web-variant build failed (exit 1)
           >     at file:///build/source/apps/kimi-code/scripts/sync-web-dist.mjs:19:9
           >     at ModuleJob.run (node:internal/modules/esm/module_job:561:25)
           >     at async node:internal/modules/esm/loader:647:26
           >     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
           >
           > Node.js v24.21.0
           For full logs, run:
             nix log /nix/store/2hlnxlg35awk53r52d21a6iiyjwc26qh-kimi-code-2.6.3.drv

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db0dd39f42

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

export type FeedbackReason = z.infer<typeof feedbackReasonsSchema>['reasons'][number];

export async function loadFeedbackReasons(): Promise<readonly FeedbackReason[] | undefined> {
const config = await getKimiWebApi().getClientConfig(FEEDBACK_REASONS_CONFIG).catch(() => undefined);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fetch reason choices from the reply's owning host

For an SSH reply whose host has a different region or KIMI_CODE_BASE_URL, this call still uses the aggregate API's locally routed getClientConfig, while createFeedback and updateFeedback are routed to the session owner. The popover therefore displays and submits the local daemon's reason IDs to feedback issued by the remote daemon. Load this configuration through the session's owning device API, as is already done for the rating itself.

Useful? React with 👍 / 👎.

Comment on lines +90 to +92
void loadFeedbackReasons().then(reasons => {
if (!selected.value.length) configuredReasons.value = reasons;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Resolve configured reasons before accepting fallback choices

When the cloud configuration is still loading, the popover immediately exposes the built-in reasons; if the user selects one before this promise resolves, the selected guard discards the fetched configuration and submits an ID that may not exist in the configured reason set. This silently defeats a dynamically configured feedback experiment for fast users or slow connections, so either wait for the fetch before enabling choices or reconcile selections with the resolved configuration.

Useful? React with 👍 / 👎.

Comment on lines +3 to +10
export const desktopFeedbackFlag = {
id: 'desktop_feedback',
env: 'KIMI_CODE_EXPERIMENTAL_DESKTOP_FEEDBACK',
title: 'Desktop feedback',
description: 'Enable global and reply feedback in the desktop app and web interface.',
default: false,
surface: 'core',
} satisfies FlagDefinitionInput;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Register the feedback flag in its owning module

When a session is produced by an agent-core entry point that does not import the KAP feedback routes, such as the CLI/TUI, the only registerFlagDefinition call never runs. FlagService.enabled('desktop_feedback') consequently remains false even when KIMI_CODE_EXPERIMENTAL_DESKTOP_FEEDBACK=1 or the master flag is set, so noteModel does not persist modelSteps; reopening that session in desktop/Web allows ratings but silently loses participating-model attribution. Register the definition from this flag module and remove the route-local registration.

AGENTS.md reference: AGENTS.md:L121-L124

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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