Skip to content

feat(tui): unify skill prompts and steering - #4165

Open
Grapedge wants to merge 11 commits into
mainfrom
tui-steer-message
Open

Grapedge wants to merge 11 commits into
mainfrom
tui-steer-message

Conversation

@Grapedge

@Grapedge Grapedge commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

统一终端界面中行首、正文内和多 Skill 输入的提交、Ctrl-S 投递、显示与历史恢复,保留完整原文及现有参数规则。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

行首单 Skill 原先走 activateSkill,正文内和多 Skill 走 promptWithSkills;Ctrl-S 没有贯通组合输入的投递选项。本次统一终端用户输入入口,不删除外部 activateSkill API。

flowchart TD
  subgraph TUI
    Input[Enter 或 Ctrl-S] --> Parse[resolveUserInput]
    Parse --> Payload[完整原文和 Skill 列表]
    Render[用户原文和 Skill 高亮]
  end
  subgraph SDK
    Payload --> Submit[Session.promptWithSkills]
  end
  subgraph klient
    Submit --> Contract[组合输入和 steerIfActive]
  end
  subgraph core
    Contract --> Prepare[校验并展开全部 Skill]
    Prepare --> Loop[loop.submit]
  end
  Loop --> Render
Loading
  • Enter 与 Ctrl-S 共用解析规则。按去重前的提及次数决定参数绑定,再按首次出现顺序去重。
  • steerIfActive 贯通 SDK、RPC、klient 和 core,依据实际投递结果处理队列。
  • SDK 将技能提交的 blocked 结果转为明确拒绝,复用现有 TUI 失败恢复;覆盖行首单 Skill、正文内、多 Skill 及空闲 Ctrl-S。提交前按同一 agent 的 PromptSubmitted 捕获现有启动 handle;引擎返回 queued 时仍等待真实启动或 Hook 拒绝,不再把入队回执当成最终成功。成功只等待 turn.ready,不等待模型回答。
  • 手动投递按队列顺序串行处理。成功前缀移除;失败 Skill 及含 Skill 的失败 Ctrl-S 批次后缀保留原文和附件,不随后续轮结束自动重发。↑ 召回或 Ctrl-S 可明确重试;自动排空 Skill 失败时,也保留其派发开始时已有的提示词后缀;bash 队列项沿原策略,不纳入 Skill 提示词批次。后来加入的普通输入和纯普通批次的策略不变。压缩或延期只是暂停未派发批次,不把剩余输入误标为失败。
  • 主会话组合 Skill 的标题和 lastPrompt 等实际启动后更新;Hook 拒绝或启动前取消不更新。元数据写入失败复用已有 warning 事件报告,不清除仍在运行的流式显示和工具状态,不把已接受的请求误报为未提交。klient/HTTP 的 queued 回执仍立即返回。
  • 旧会话 Skill 请求的迟到错误不会清除新会话状态;若真实 Goal 续轮已启动,Skill 请求被拒绝只显示错误,不清除该轮。
  • 实时显示与历史恢复使用激活元数据高亮,不从普通历史文本猜测 Skill。读取 inTurn,区分正常用户轮与轮内追加输入。
  • VS Code 原先只还原旧 skill_activation 命令,组合输入会显示展开指令。恢复时按指令 part 的来源标记过滤;没有 part 标记的旧组合记录沿用激活列表所确定的前导指令边界。原文、媒体、旧单 Skill 命令还原、Hook 输出与用户自写 XML 保留,不改保存的数据或模型输入。
  • Skill Enter 复用普通 Enter 已有的最多 2 秒媒体准备等待;提前完成立即继续,失败不发送,也不覆盖等待期间的新草稿。没有改普通输入、Ctrl-S 或媒体提示界面。
  • 去掉 Goal active 单独造成的 Skill 本地排队条件;idle 且无其他阻塞时直接提交,执行中、压缩和批次在途仍排队。没有改 Goal 或 WaitFor/Tower 的调度策略。
  • BTW 的显式 Skill 输入复用媒体提取、Skill 参数准备和最多 2 秒等待;请求携带实际图片/视频 parts,面板保留完整原文。附件租约按 agentId 与 turnId 隔离,主会话结束不会误释放 BTW 附件;准备期间关闭面板不会改投主会话;启动等待期间关闭或替换面板后,迟到拒绝不把旧草稿恢复到共享编辑器。普通 BTW 输入、工具权限和 Ctrl-S 不变。
  • 媒体等待前记录原会话和附件 store generation;显式换会话或清空附件后取消旧 Skill 输入,不改投新会话,也不覆盖新草稿。首次懒创建会话且附件未清空时继续提交。
  • cache-hint 选择新会话时保留附件快照,Skill 参数仍得到可读的图片/视频缓存路径;不认领或释放新会话复用编号的附件。只在 store 完整清空后整体清除旧附件编号,保留图片 parts 的对应顺序。
  • 唯一行首 Skill 仍须由原 slash parser 识别。以换行直接分隔名称和正文的输入保持字面消息;真实编辑器将 Tab 归一化为空格的行为不变。
  • 队列视频的原生文件引用过期时,仅在已成功生成绑定 Skill 参数的可读缓存副本后移除该引用。排空和 Ctrl-S 共用此规则,不新增上传重试,不改普通或无绑定参数视频的过期策略。
  • 保留 CLI minor changeset。撤回的 Skill 使用补充不恢复,只修正中英文交互指南和 WaitFor 工具说明,区分自动投递与 Ctrl-S 手动投递。

Behavior Changes and Affected Users

行为 修改前 修改后 受影响人群 退路或确认
用户 Skill 显示 行首单 Skill 显示激活卡和截断参数摘要;组合输入显示激活卡及正文 只显示完整用户原文并高亮已激活标记,Fullscreen 摘要复用同一着色 TUI Skill 用户,包括历史会话读取者 确认以原文消息替代用户 Skill 激活卡;不提供旧展示开关
行首单 Skill 的模型输入 使用独立激活路径,不附加完整命令原文 展开的 Skill 指令与完整原文、媒体合为一条 User 消息的多个 content part TUI 行首单 Skill 用户及接收该输入的模型 有意保留原文,不要求模型输入逐字沿用旧路径
参数和命令优先级 行首单次提及绑定参数,正文内或多次提及无参数;内建和插件命令优先 Enter 与 Ctrl-S 共用相同规则,重复提及在去重前计数;已知行首 namespaced 名称与普通路径保持区分 TUI Skill、插件与内建命令用户 原有参数规则和命令优先级保留
Ctrl-S 草稿与混合队列 正文内及组合 Skill 输入不能 steer,且可阻挡后续输入;行首草稿可能仅作为文本发送 完整 Skill 输入可投递;普通输入与 Skill 输入按队列顺序处理,避免重复提交和新输入超车 执行期间使用 Ctrl-S 的 TUI 用户 Enter 仍可排队;bash 输入仍留队,不参与手动 steer
明确提交失败与召回 不同 Skill 路径恢复不同;失败组合输入回到普通队列后,可能在后续轮结束时自动重发 失败 Skill、含 Skill 的失败 Ctrl-S 批次后缀,以及自动 Skill 派发开始时已有的非 bash 后缀,仅供明确重试;已接受前缀不重发,保留基础附件 遇到提交或媒体准备错误的 TUI Skill 用户 不保留失败 Skill 的自动重试;空编辑器用 ↑ 召回并编辑,忙碌时可再按 Ctrl-S。批次外普通输入、纯普通失败批次不变
UserPromptSubmit 拦截技能输入 旧行首独立激活使用 skill_activation 来源,不进入此 Hook;正文内和多 Skill 的 blocked 结果被 SDK 丢弃 统一输入使用 user 来源,经过 Hook;返回 blocked 时 SDK 明确拒绝,TUI 恢复空闲并保留输入和附件 配置该 Hook 的 TUI Skill 用户及调用 Session.promptWithSkills 的 SDK 用户 Hook 仍可阻止执行;未改普通 prompt、外部 activateSkill、klient 或 HTTP 结果契约
主会话 Skill 的标题与 lastPrompt 旧行首独立激活等启动后写;组合输入提交前就写,排队或 Hook 拒绝也可能覆盖元数据 组合 Skill 等实际启动后写;拒绝或启动前取消不写;写失败通过现有 warning 事件报告,不打断该轮的流式显示,已接受回执仍成功 提交 Skill 的 TUI、SDK、klient/HTTP 用户及读取会话列表的客户端 普通 prompt 和外部 activateSkill 的路径保留,不增元数据错误协议
排队 Skill 与普通输入的摘要顺序 组合 Skill 按提交时更新 lastPrompt Skill 改按启动时更新,晚启动的 Skill 可能覆盖较晚提交的普通输入摘要;标题与 lastPrompt 可能来自不同提交,摘要不再统一反映提交顺序 从 SDK/HTTP 会话列表读取 lastPrompt 的客户端 没有组合 Skill 提前写摘要的选项;本 PR 不增加普通输入元数据调度,以消息历史确认实际内容。此时序需要维护者在本 PR 明确确认
Skill 异步失败的会话与轮次归属 迟到的拒绝可能清除新会话或随后启动的真实轮次状态 只恢复原会话中尚未启动的请求;已有真实 turnId 时仅显示错误 发送 Skill 后切换会话,或 Skill 在 Goal 续轮后被 Hook 拒绝的 TUI 用户 不改变 Goal 调度或普通输入错误策略
SDK 排队 Skill 请求的结算 旧行首 activateSkill 等待真实启动;组合 SDK 收到 queued 后立即 resolve,稍后 Hook 拒绝无法传回 Session.promptWithSkills 等待实际启动或拒绝;Hook blocked 抛 request.invalid,启动前取消或 gate 失败沿用现有启动失败的 internal 错误 在 Goal 续轮、暂停或其他引擎忙碌状态下调用并等待组合 Skill 的 TUI/SDK 用户 不再提供组合 SDK 的提前成功回执;可先发请求,再独立恢复或取消,不应先 await 排队请求再恢复。klient/HTTP 的即时 queued 结果、普通 prompt 和外部 activateSkill 保持不变
媒体参数与队列 行首路径转换媒体参数,普通队列在排空时刷新引用 组合路径继续转换参数中的媒体引用并管理额外租约;排空沿用普通媒体队列政策,不增加模型能力再校验 图片、视频及排队后切换模型的 TUI 用户 初次媒体能力校验保留
Skill Enter 的视频准备 旧行首单 Skill 使用本地参数路径;正文内和多 Skill 可能在文件保存未完成时立即拒绝 统一 Skill Enter 复用已有媒体准备等待,上限 2 秒;超时保留输入,后台稍后完成不自动重发 粘贴视频后立即提交 Skill 的 TUI 用户 不恢复行首专用回退;未改普通 Enter、Ctrl-S 或视频提示界面
Goal 下 idle 边界的 Skill 投递 旧行首单 Skill 直接向引擎提交;共享 Skill 入口单因 Goal active 留在终端 移除共享入口的额外 Goal 条件,已有忙碌、压缩、延期和在途条件保留 Goal active、TUI idle 且提交显式 Skill 的用户 不承诺固定下一轮优先或实际合并,不改引擎调度、普通输入或 Goal 的预算/暂停/取消
打开的 BTW 面板接收 Skill 与附件 旧行首单 Skill 绕过 BTW 发往主会话并转换媒体参数;正文内/多 Skill 发 BTW 时只传占位符 行首/正文内/多 Skill 由同一主编辑器投递至打开的 BTW 面板,并携带实际媒体 parts;initial /btw 含 Skill 也复用相同准备函数;面板关闭或替换后,不恢复旧请求的草稿 BTW 面板打开时提交显式 Skill 的 TUI 用户 保留统一后的 BTW 路由;先关闭 BTW 面板可发往主会话。不扩大工具权限,也不顺带修普通 BTW 输入的历史媒体缺口
媒体等待期间换会话 统一入口等待完成后可能从当前会话和已清空的附件 store 读取旧输入 记录会话及附件 generation,显式换会话/清空后取消旧 Skill;首次懒创建但附件未清空时继续 视频准备期间运行 /new 或切换会话的 TUI Skill 用户 明确报错,不发送到新会话、不覆盖新草稿;切回所需会话后重新粘贴并提交
cache-hint 新会话中的 Skill 媒体参数 旧行首独立路径先转换参数;统一后的延后转换可能在 store 清空后留下占位符 保留原附件快照并生成可读缓存路径,隔离新会话复用编号的附件;不对 parts 对应的编号做部分过滤 触发缓存过期提示并选择新会话的行首带媒体 Skill 用户 保留原文与媒体;没有改普通输入或 cache-hint 的选择规则
唯一行首 Skill 后直接换行 原 slash parser 将名称与换行后正文视为未知命令,按字面消息发送 保留该规则,不因统一扫描而自动激活;编辑器 Tab 归一化保持不变 粘贴多行文本、首行看似 Skill 命令的 TUI 用户 在名称后加空格才使用既有参数语法;正文内和多提及规则不变
排队 Skill 的视频引用过期 旧行首路径使用本地缓存参数;统一后的队列可能携带过期原生引用 若绑定参数已生成可读视频副本,移除对应过期原生引用,继续使用缓存参数 队列等待超过文件有效期的行首带视频 Skill 用户 未改普通或无参数视频的 TTL,不新增上传重试
用户 Skill 事件与其他激活卡 激活事件可生成用户 Skill 卡 事件和激活关联保留,但用户 user-slash 不生成重复卡;模型自主及嵌套激活卡保持不变 TUI 用户,以及消费 SDK 激活事件的调用方 事件契约保留,非用户激活的显示不变
历史恢复与用户轮计数 旧单 Skill 记录使用激活卡;SDK 可将轮内追加输入误计为新用户轮 原文优先恢复;缺少原文的旧记录规范还原命令;带 inTurn 的输入仍归原轮 TUI 恢复会话用户、使用历史轮数限制的 SDK 调用方 只改读取,不迁移或写回旧会话;缺少 inTurn 的旧记录沿用原规则
组合提交选项 无组合输入的 steer 选项 新增可选 steerIfActive;省略或 false 保持普通提交,true 尝试注入当前轮,否则沿用现有启动或调度逻辑 SDK 和 klient memory/IPC 调用方 可选字段向后兼容;activateSkill、kap-server HTTP 路径、配置与环境变量不变
自动队列投递策略 Tower、WaitFor 的自动队列投递排除含 bash 或 Skill 的队列;失败混合批次只剩普通输入时仍可能自动重试 自动 steer 同样不接受含仅供手动恢复项的队列;手动 Ctrl-S 可明确重试,仍排除 bash 开启 Tower 或使用 WaitFor、混合批次失败后继续输入的 TUI 用户 未含手动恢复项的普通队列不变;有该项时,批次外普通输入可在轮结束后发送,或用 Ctrl-S 明确投递整个队列,不保证立即自动 steer
VS Code 恢复技能输入 旧行首单 Skill 还原命令;组合输入会显示展开指令 按 part 来源标记或旧记录的激活列表识别指令,原文和媒体保持完整 在 VS Code 恢复 TUI Skill 会话的用户,包括无 part 标记的旧组合记录 旧命令还原不变;不修改持久化格式、模型输入或 VS Code 轮次协议

涉及模块及测试覆盖:

  • TUI 解析、队列、媒体与键盘:resolve.test.ts、editor-keyboard.test.ts、kimi-tui-message-flow.test.ts。
  • 实时与历史渲染、Fullscreen:user-message.test.ts、sticky-user-message.test.ts、message-replay.test.ts,覆盖旧记录、轮归属、撤销和高亮。
  • SDK 与客户端契约:replay.test.ts、session-skills.test.ts、RPC 测试、klient facade 和 memory/IPC conformance。真实本地 Hook 返回退出码 2,覆盖三种 Skill 位置/数量及空闲 steer;断言请求拒绝、不启动轮次且下一次提交可接受。TUI 回归覆盖恢复空闲、无成功用户条目、附件召回及编辑后重新提交。
  • core:activateSkill.test.ts,覆盖整体准备、参数、实际 steer 结果及 inTurn;kap-server API surface 检查保留。
  • VS Code:replay-adapter.test.ts、replay-resume.integration.test.ts、event-adapter.test.ts。回归覆盖带 part 标记和无 part 标记的旧组合记录,包含行首、正文内、多 Skill、重复提及、图片和视频,以及无激活标记的用户自写 XML。
  • 用户已进行手动体验并认可原文展示方案;没有逐项手动验收记录。自动验证使用本地测试替身和可控模型适配器,不将其视为真实 LLM 端到端测试。

验证结果:

  • 本轮相关回归:TUI 九个测试文件 571 passed,SDK 五个文件 115 passed,core Skill 文件 14 passed,kap-server API surface 1 passed。这些是定向结果,不是重新运行本机完整套件。
  • 先复现失败 Skill 的自动重试,再锁定失败批次后缀、批次外普通输入、明确 Ctrl-S 重试、↑ 召回重解析、压缩延期、换会话及真实 Goal 续轮不被清除。另有 Tower/WaitFor 两例先复现普通失败后缀被自动重发,再验证只能明确重试。自动排空失败的后缀回归先复现原有后缀越过失败 Skill,再锁定原有提示词后缀留队、后来普通输入仍可发送和明确 Ctrl-S 按序恢复。另钉住 bash 队列项仍走原 Shell 派发策略,不被 Skill 失败冻结。媒体保留到明确召回或重试,最终仅释放一次。
  • 真实本地 SDK/引擎、启动前配置的 Node Hook 和受控模型响应覆盖放行/拒绝:拒绝时标题与 lastPrompt 不变,排队时不提前覆盖,放行并启动后才更新。core 故障注入覆盖 fresh/queued 两种形状,元数据写失败产生 warning 而非 error 事件,回执仍表示已接受。TUI 对照覆盖 warning 保留运行中工具、error 沿用原清理行为。另有关闭/替换 BTW 面板的两例先复现旧草稿跨接收方恢复,再验证不恢复、不自动重发。
  • Core、SDK、CLI 独立类型检查和构建通过;lint 2803 warnings、0 errors。SDK API Extractor 成功,保留既有 TSDoc/TypeScript warnings。
  • 使用实际编辑器、真实本地 SDK/引擎和受控 provider 的媒体检查 2 passed:当前 queued Skill 不提前释放图片,自己的模型请求含图片;模拟旧 SDK 提前成功回执可复现丢图。该反例不是完整旧发行版差分,不是远程视觉理解测试。
  • 之前的 BTW、Goal、视频及 VS Code 定向检查保留:BTW 最终模型请求携带图片;Goal idle 边界已实际向引擎提交;VS Code 三个文件 62 passed;中英文文档、扩展及 Webview 检查通过。没有真人稳定命中 Goal 边界、真实剪贴板视频到远程模型或 BTW 远程视觉理解的验收结果。
  • 本机完整测试套件仅初始阶段运行一次:16,826 passed、51 skipped、3 failed。两个未改 native artifact 测试因 PATH 缺少 zstd 失败;一个未改 foreground subagent 用例在当前代码和基准中均独立复现 30 秒超时。未改超时值或跳过测试。依赖实际服务的 legacy 测试未连接个人服务。
  • 全仓类型检查曾两次达到命令时间上限,不能报告本轮全仓成功。早期 CI 的 Tower 日志顺序失败没有扩范围修改;后续已推送 HEAD 的 CI 通过不代表已诊断该历史问题。
  • 本轮 BTW 草稿归属和元数据 warning 两项修复通过三轴本地只读评审。Hook 拒绝的 Skill 在实时与恢复界面中显示不一致,仍待选择,未在这次补丁中修改;摘要顺序的不对称已在表中声明。原 CLI minor Changeset 不变,不恢复撤回的 Skill 教程。
  • 历史 VS Code inTurn 分组和 TUI /undo 显示裁剪问题未修;没有新增 Goal 全局优先级、Ctrl-S 媒体等待、加载组件、公共 promptId 选项或取消错误协议。

尚未收束:Hook 拒绝的 Skill 不进入实时用户条目,但引擎会保存该尝试,恢复时仍显示原文。需要选择仅在 TUI 恢复时隐藏这类条目,或在实时与恢复界面均保留完整原文并明确标注“被拒绝”。两者都不改变模型上下文或公共协议;本 PR 尚未实施任何一种。摘要顺序的维护者确认仍未取得。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • 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.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 07:45
@changeset-bot

changeset-bot Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 57a82aa

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

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Minor

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-11T20:50:55.923764Z 57a82aa 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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 10, 2026 •

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

commit: 57a82aa

Copilot AI 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.

🔵 Needs a closer look

It reworks core skill-prompt submission, steering, and replay semantics across the SDK contract and four packages, so it needs human sign-off despite its extensive test coverage.

0 open findings

What changed in this PR

This PR unifies the terminal UI's skill-prompt entry points so that leading single-skill commands, inline mentions, and multi-skill inputs all flow through one path (resolveUserInput → Session.promptWithSkills), rather than splitting between the old activateSkill and promptWithSkills routes. It preserves the full user text, highlights activated skill markers instead of rendering separate "user skill" activation cards, and extends Ctrl-S steering to cover combined/skill inputs. A new optional steerIfActive flag is plumbed through the SDK, RPC, klient contract, and the agent-core-v2 engine so a bundled submission can be injected into a running turn.

Changes:

  • Add steerIfActive to promptWithSkills end-to-end (node-sdk → rpc → klient schema → AgentSkillService), injecting into the active turn when running and queuing otherwise.
  • Replace the per-skill activation-card rendering for user-slash skills with a single highlighted user transcript entry (live + replay), tracked via seenSkillActivationIds; model-tool activations still render cards.
  • Rewrite TUI queue steering into a serial, group-aware steerQueuedMessagesIntoRunningTurn(manual) that preserves failed/subsequent items and manages media leases; remove sendSkillActivation/steerSkillActivation and QueuedMessage.mode: 'skill'.
  • Add inTurn origin flag so steered in-turn appends are not miscounted as new user turns, and sync EN/ZH skill docs plus a minor changeset.
File Description
packages/​node-sdk/​src/​session.ts /​ rpc.ts /​ sdk-rpc-client-v2.ts Add optional steerIfActive to the public promptWithSkills contract and RPC input.
packages/​node-sdk/​src/​replay.ts /​ context.ts Treat inTurn user messages as not starting a new replay turn; add inTurn? to origin types.
packages/​klient/​src/​contract/​agent/​schemas.ts Accept optional steerIfActive on the wire.
packages/​agent-core-v2/​src/​features/​skill/​skillService.ts /​ skill.ts Steer bundled submission into the running turn when requested, else queue.
apps/​kimi-code/​src/​tui/​commands/​resolve.ts /​ dispatch.ts Unify input resolution; argument binding only for a single leading mention.
apps/​kimi-code/​src/​tui/​kimi-tui.ts Serial queue steering, skill-arg media preparation/leases, failure/recall handling, highlighted user entries.
apps/​kimi-code/​src/​tui/​controllers/​editor-keyboard.ts Ctrl-S queues the draft then delegates to the coordinator's manual steer.
apps/​kimi-code/​src/​tui/​controllers/​session-replay.ts /​ session-event-handler.ts Render user-slash skills as user prompts; rename to seenSkillActivationIds.
apps/​kimi-code/​src/​tui/​components/​messages/​user-message.ts /​ sticky-user-message.ts Highlight activated skill tokens in the user message and Fullscreen summary.
apps/​kimi-code/​src/​tui/​utils/​{message-replay,inline-skill-tokens}.ts, types.ts Prompt-text reconstruction, leading namespaced-slash tokenization, queue/steer type updates.
docs/​{en,zh}/​customization/​skills.md, .changeset/​unify-skill-prompts.md Document the unified invocation/Ctrl-S behavior and add a minor changeset.
Test files (TUI, node-sdk, klient, agent-core-v2) Extensive coverage of parsing, steering, media, replay, and the new contract option.

I traced the argument/dedup rules, the serial steering state machine, media-lease handoff on success/failure/recall, the replay dedup via seenSkillActivationIds, and the steerIfActive plumbing against the included tests, and did not find a concrete defect to flag. The change is nonetheless broad and high-risk: it alters the core prompt-submission semantics that every skill user hits, changes a public SDK method contract, and rewrites the steering/replay paths across four packages.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@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: 2bcc7313d7

ℹ️ 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/kimi-code/src/tui/commands/dispatch.ts
Comment thread .changeset/unify-skill-prompts.md
@Grapedge

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: c894552371

ℹ️ 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".

@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: 95f413f82f

ℹ️ 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/kimi-code/src/tui/commands/dispatch.ts
Comment thread apps/kimi-code/src/tui/controllers/editor-keyboard.ts
Comment thread packages/agent-core-v2/src/features/skill/skillService.ts
Comment thread apps/kimi-code/src/tui/commands/dispatch.ts

@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: 0906abe0df

ℹ️ 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/kimi-code/src/tui/commands/resolve.ts
Comment thread apps/kimi-code/src/tui/commands/dispatch.ts
Comment thread apps/kimi-code/src/tui/kimi-tui.ts

@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: e889df4bc0

ℹ️ 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/kimi-code/src/tui/commands/dispatch.ts

@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: 634970db73

ℹ️ 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/kimi-code/src/tui/kimi-tui.ts
Comment thread apps/kimi-code/src/tui/kimi-tui.ts Outdated
Comment thread apps/kimi-code/src/tui/commands/resolve.ts
Comment thread apps/kimi-code/src/tui/commands/dispatch.ts
@Grapedge

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 5d59a407cc

ℹ️ 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/kimi-code/src/tui/kimi-tui.ts

@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: cf9428995a

ℹ️ 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/kimi-code/src/tui/kimi-tui.ts
Comment thread apps/kimi-code/src/tui/kimi-tui.ts Outdated
Comment thread apps/kimi-code/src/tui/commands/dispatch.ts
Comment thread packages/node-sdk/src/sdk-rpc-client-v2.ts

@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: 1ce680f050

ℹ️ 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/kimi-code/src/tui/kimi-tui.ts

@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: d4d9f80b7e

ℹ️ 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".

this.releaseSkillArgumentMedia(prepared);
restoreInput();
});
await request;

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 Keep blocked skill history consistent with the live transcript

When a UserPromptSubmit hook blocks a skill, settleGateRejectedPrompt still appends the blocked user message to persisted context (loopService.ts:619-626) before the SDK rejects. Because this path appends the live user entry only after await request, the TUI instead restores the input as manualOnly, while SessionReplayRenderer.renderBundledPrompt later renders the persisted attempt. A blocked /skill:… therefore disappears from the current transcript but reappears after resuming the session, and an edited retry leaves the live view hiding an earlier message that remains in model history. Fresh evidence beyond the earlier blocked-hook finding is this persistence/replay discrepancy after rejection propagation was fixed; either render the blocked attempt consistently or exclude it from replay/history.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

问题成立。引擎沿用既有行为保存被拦输入及 hook_result.blocked;本 PR 的拒绝传播使实时界面保留恢复输入却不产生用户条目,而恢复读取仍展示该尝试。此项尚未修改,讨论保持开放:需要选择仅在 TUI 恢复时隐藏这类条目,或在实时与恢复界面均保留完整原文并明确标注“被拒绝”。不擅自删除模型上下文、改 PromptGate 或新增公共协议。

Comment thread apps/kimi-code/src/tui/controllers/btw-panel.ts Outdated
Comment thread packages/agent-core-v2/src/features/skill/skillService.ts

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.

3 participants