Repository navigation
Conversation
Give NotifyUser a one-line title, report the latest update on the session status, and forward subagent updates to the parent so GUI clients can show them on subagent cards.
🦋 Changeset detectedLatest commit: ed8f468 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
🟡 Changes recommended
打包 Web 资源未同步,且一行标题约束与 changeset 的兼容性说明仍不完整。
3 open findings
What changed in this PR
该 PR 扩展实验性 NotifyUser,让进展标题、会话最新状态及子 Agent 更新可供 TUI、desktop 和 Web 使用。
Changes:
- 为
NotifyUser增加必填标题,并更新 TUI 展示。 - 新增
latest_update、subagent.update和 transcript 任务更新。 - 补充协议、双语文档、changeset 与端到端测试。
| File | Description |
|---|---|
.changeset/notify-user-titles-gui.md |
添加用户可见变更记录。 |
apps/kimi-code/src/tui/components/chrome/notify-panel.ts |
展示及折叠预览更新标题。 |
apps/kimi-code/src/tui/components/messages/tool-call.ts |
使用标题作为工具卡片摘要。 |
apps/kimi-code/src/tui/controllers/notify.ts |
将标题传递到更新面板。 |
apps/kimi-code/test/tui/components/messages/tool-call.test.ts |
测试标题卡片。 |
apps/kimi-code/test/tui/components/panels/notify-panel.test.ts |
测试面板标题渲染。 |
apps/kimi-code/test/tui/controllers/notify.test.ts |
测试标题采集及回退。 |
docs/en/reference/server-api.md |
记录新增会话及事件字段。 |
docs/en/reference/tools.md |
更新英文工具说明。 |
docs/zh/reference/server-api.md |
同步中文服务端 API 文档。 |
docs/zh/reference/tools.md |
同步中文工具说明。 |
packages/agent-core-v2/docs/state-manifest.d.ts |
更新活动状态清单。 |
packages/agent-core-v2/docs/wire-manifest.d.ts |
登记 durable 更新事件。 |
packages/agent-core-v2/src/app/agentProfileCatalog/profile-shared.ts |
更新模型使用指导。 |
packages/agent-core-v2/src/app/telemetry/events.ts |
增加标题长度指标。 |
packages/agent-core-v2/src/events.ts |
扩展 Agent 事件联合类型。 |
packages/agent-core-v2/src/features/notify/flag.ts |
更新实验开关描述。 |
packages/agent-core-v2/src/features/notify/notifyUserNudge.ts |
更新进展提醒文案。 |
packages/agent-core-v2/src/features/notify/subagentUpdate.ts |
定义子 Agent 更新事件。 |
packages/agent-core-v2/src/features/notify/tools/notify-user/notify-user.md |
更新工具提示词。 |
packages/agent-core-v2/src/features/notify/tools/notify-user/notify-user.ts |
新增标题输入契约。 |
packages/agent-core-v2/src/features/notify/tools/notify-user/notifyUserTool.ts |
校验标题并转发子 Agent 更新。 |
packages/agent-core-v2/src/index.ts |
导出新事件。 |
packages/agent-core-v2/src/session/sessionActivity/sessionActivity.ts |
扩展活动状态类型。 |
packages/agent-core-v2/src/session/sessionActivity/sessionActivityService.ts |
跟踪及清除最新进展。 |
packages/agent-core-v2/test/features/notify/tools/notify-user.test.ts |
覆盖标题与父 Agent 转发。 |
packages/agent-core-v2/test/index.test.ts |
验证新 wire 记录类型。 |
packages/agent-core-v2/test/session/sessionActivity/sessionActivityService.test.ts |
覆盖最新进展生命周期。 |
packages/kap-server/src/protocol/events-zod.ts |
增加事件 wire schema。 |
packages/kap-server/src/protocol/session.ts |
定义 latest_update wire 结构。 |
packages/kap-server/src/routes/sessions.ts |
在 v1 会话中投影最新进展。 |
packages/kap-server/src/routes/v2/sessions.ts |
在 v2 活动状态中投影进展。 |
packages/kap-server/src/services/transcript/coreEventMap.ts |
投影子 Agent 进展到任务。 |
packages/kap-server/src/start.ts |
声明更新面板能力。 |
packages/kap-server/src/transport/ws/v1/events.ts |
扩展工作状态事件类型。 |
packages/kap-server/src/transport/ws/v1/sessionEventBroadcaster.ts |
广播进展并接入 transcript。 |
packages/kap-server/test/services/transcript.test.ts |
测试实时任务进展。 |
packages/kap-server/test/sessionEventBroadcaster.test.ts |
测试进展广播和清除。 |
packages/kap-server/test/sessions.test.ts |
测试能力声明及 REST 输出。 |
packages/klient/src/contract/session/activity.ts |
扩展客户端活动契约。 |
packages/node-sdk/test/sdk-rpc-client-v2.test.ts |
更新 NotifyUser 调用参数。 |
packages/node-sdk/test/session-event-types.test.ts |
验证新公开事件类型。 |
packages/node-sdk/test/session-prompt-events.test.ts |
更新提示事件测试数据。 |
packages/transcript/src/contract/schema.ts |
扩展任务 schema。 |
packages/transcript/src/history/foldFacts.ts |
从历史记录恢复进展。 |
packages/transcript/src/model/task.ts |
定义任务更新及数量上限。 |
packages/transcript/src/ops/apply.ts |
比较任务更新内容。 |
packages/transcript/test/layers.test.ts |
测试历史折叠和上限。 |
packages/transcript/test/store.test.ts |
测试更新 upsert 幂等性。 |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| title: z | ||
| .string() | ||
| .min(1) | ||
| .describe( | ||
| "A one-line headline the user can take in at a glance: the conclusion or current phase, in the user's language, under ~60 characters, plain text.", | ||
| ), |
| skillDirs: opts.skillDirs, | ||
| displayName: opts.hostIdentity.displayName, | ||
| replyStyleGuide: opts.hostIdentity.replyStyleGuide, | ||
| uiCapabilities: [NOTIFY_USER_UI_CAPABILITY], |
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Give experimental NotifyUser updates a one-line title that the TUI Updates panel shows above the message, and offer NotifyUser in `kimi web` sessions; enable with `KIMI_CODE_EXPERIMENTAL_NOTIFY_USER=1` or `[experimental] notify_user = true`. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a0e423688
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| skillDirs: opts.skillDirs, | ||
| displayName: opts.hostIdentity.displayName, | ||
| replyStyleGuide: opts.hostIdentity.replyStyleGuide, | ||
| uiCapabilities: [NOTIFY_USER_UI_CAPABILITY], |
There was a problem hiding this comment.
Ship the matching web bundle with this capability
When an opt-in user starts the bundled kimi web, this line tells the engine that the host supports progress updates, but the commit contains no apps/kimi-code/dist-web changes and explicitly defers the matching code-app UI sync. The released web client therefore receives a tool that reports updates as displayed without shipping the new progress rows, status line, session subtitles, or subagent-card UI documented by this change; sync and commit the built web bundle before advertising the capability.
AGENTS.md reference: AGENTS.md:L17-L18
Useful? React with 👍 / 👎.
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Give experimental NotifyUser updates a one-line title that the TUI Updates panel shows above the message, and offer NotifyUser in `kimi web` sessions; enable with `KIMI_CODE_EXPERIMENTAL_NOTIFY_USER=1` or `[experimental] notify_user = true`. |
There was a problem hiding this comment.
Name the loss of message-only calls in the changeset
For enabled sessions or hosts that still produce the previously valid { message } input, the new schema requires title and rejects that call, but this changeset only says updates gain a title and does not disclose that message-only calls stop working. Disabling the experimental feature removes NotifyUser altogether rather than preserving the old behavior, so the release note should name this loss and the change needs either a backward-compatible fallback or explicit maintainer sign-off.
AGENTS.md reference: AGENTS.md:L102-L104
Useful? React with 👍 / 👎.
Flip the notify_user flag default to true; the flag stays as the opt-out (`[experimental] notify_user = false` or KIMI_CODE_EXPERIMENTAL_NOTIFY_USER=0). Register the new subagent.update wire record in the vis renderers and record-type union so the manifest coverage test passes.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 541559c8ef
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .string() | ||
| .min(1) |
There was a problem hiding this comment.
Reject line breaks in progress titles
If the model emits a title containing an internal newline, this schema accepts it because it only requires one character, and the runtime check only rejects an all-whitespace title. The TUI's collapsed panel later returns that title verbatim from stubPreviewText() and embeds it into a single rendered row, so a supposedly one-line title can split the row and corrupt the panel framing; enforce the documented single-line constraint in the schema.
Useful? React with 👍 / 👎.
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |


Requirement or Bug
让 web / Desktop 用户也能看到 agent 的进展更新(NotifyUser)。第一版只做最小形态:对话里的进展行。界面部分在 MoonshotAI/kimi-code-app#835。
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
NotifyUser新增可选title参数(一行标题);空标题、多行标题、非字符串标题会被拒绝,message单独传入时保持原有行为。工具描述、系统提示词、提醒文案同步指导模型写标题,遥测新增title_chars。update_panel能力,web / Desktop 会话因此获得该工具(此前只有 TUI 声明)。notify_user默认值改为true,保留三种关闭方式:[experimental] notify_user = false、KIMI_CODE_EXPERIMENTAL_NOTIFY_USER=0、/experiments。SessionActivity.latest_update、subagent.updatedurable 事件和task.updates,因此不新增任何 durable 记录类型:wire / state manifest、transcript、klient、vis、node-sdk 源码均无变化。Behavior Changes and Affected Users
[experimental] notify_user = false/KIMI_CODE_EXPERIMENTAL_NOTIFY_USER=0//experimentsmessagetitle,含单行校验message单独传入保持可用)update_panel,web / Desktop 会话没有该工具messagetitle+message两段结构messageupdate_panellatest_update、subagent.update、task.updates已按简化方向移除)受影响模块与测试覆盖:
agent-core-v2:notify-user.test.ts覆盖titleschema、空标题/多行标题/非字符串标题校验、message单独传入的兼容行为、默认开启与关闭、宿主能力、遥测。node-sdk:sdk-rpc-client-v2.test.ts、session-prompt-events.test.ts中的 NotifyUser 调用带title。notify-panel.test.ts、tool-call.test.ts、controllers/notify.test.ts覆盖标题展示。env=0/ 配置false三种配置下工具与提示词的有无;会话 JSON 与 v1 / v2 列表均无latest_update;transcript 无task.updates;wire log 无subagent.update;服务重启后恢复正常。合并顺序:本 PR → app #835(submodule 指向本 PR 合并后的 main 提交)→ 发布前从 code-app main 同步
dist-web(否则kimi web只显示通用工具卡片)。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.