Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 57a82aa 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.
🔵 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
steerIfActivetopromptWithSkillsend-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; removesendSkillActivation/steerSkillActivationandQueuedMessage.mode: 'skill'. - Add
inTurnorigin 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.
There was a problem hiding this comment.
💡 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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; |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
问题成立。引擎沿用既有行为保存被拦输入及 hook_result.blocked;本 PR 的拒绝传播使实时界面保留恢复输入却不产生用户条目,而恢复读取仍展示该尝试。此项尚未修改,讨论保持开放:需要选择仅在 TUI 恢复时隐藏这类条目,或在实时与恢复界面均保留完整原文并明确标注“被拒绝”。不擅自删除模型上下文、改 PromptGate 或新增公共协议。
Requirement or Bug
统一终端界面中行首、正文内和多 Skill 输入的提交、Ctrl-S 投递、显示与历史恢复,保留完整原文及现有参数规则。
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
行首单 Skill 原先走
activateSkill,正文内和多 Skill 走promptWithSkills;Ctrl-S 没有贯通组合输入的投递选项。本次统一终端用户输入入口,不删除外部activateSkillAPI。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 --> RendersteerIfActive贯通 SDK、RPC、klient 和 core,依据实际投递结果处理队列。blocked结果转为明确拒绝,复用现有 TUI 失败恢复;覆盖行首单 Skill、正文内、多 Skill 及空闲 Ctrl-S。提交前按同一 agent 的PromptSubmitted捕获现有启动 handle;引擎返回queued时仍等待真实启动或 Hook 拒绝,不再把入队回执当成最终成功。成功只等待turn.ready,不等待模型回答。lastPrompt等实际启动后更新;Hook 拒绝或启动前取消不更新。元数据写入失败复用已有 warning 事件报告,不清除仍在运行的流式显示和工具状态,不把已接受的请求误报为未提交。klient/HTTP 的queued回执仍立即返回。inTurn,区分正常用户轮与轮内追加输入。skill_activation命令,组合输入会显示展开指令。恢复时按指令 part 的来源标记过滤;没有 part 标记的旧组合记录沿用激活列表所确定的前导指令边界。原文、媒体、旧单 Skill 命令还原、Hook 输出与用户自写 XML 保留,不改保存的数据或模型输入。WaitFor工具说明,区分自动投递与 Ctrl-S 手动投递。Behavior Changes and Affected Users
skill_activation来源,不进入此 Hook;正文内和多 Skill 的blocked结果被 SDK 丢弃user来源,经过 Hook;返回blocked时 SDK 明确拒绝,TUI 恢复空闲并保留输入和附件Session.promptWithSkills的 SDK 用户activateSkill、klient 或 HTTP 结果契约activateSkill等待真实启动;组合 SDK 收到queued后立即 resolve,稍后 Hook 拒绝无法传回Session.promptWithSkills等待实际启动或拒绝;Hook blocked 抛request.invalid,启动前取消或 gate 失败沿用现有启动失败的internal错误queued结果、普通 prompt 和外部activateSkill保持不变/btw含 Skill 也复用相同准备函数;面板关闭或替换后,不恢复旧请求的草稿/new或切换会话的 TUI Skill 用户user-slash不生成重复卡;模型自主及嵌套激活卡保持不变inTurn的输入仍归原轮inTurn的旧记录沿用原规则steerIfActive;省略或 false 保持普通提交,true 尝试注入当前轮,否则沿用现有启动或调度逻辑activateSkill、kap-server HTTP 路径、配置与环境变量不变涉及模块及测试覆盖:
resolve.test.ts、editor-keyboard.test.ts、kimi-tui-message-flow.test.ts。user-message.test.ts、sticky-user-message.test.ts、message-replay.test.ts,覆盖旧记录、轮归属、撤销和高亮。replay.test.ts、session-skills.test.ts、RPC 测试、klient facade 和 memory/IPC conformance。真实本地 Hook 返回退出码 2,覆盖三种 Skill 位置/数量及空闲 steer;断言请求拒绝、不启动轮次且下一次提交可接受。TUI 回归覆盖恢复空闲、无成功用户条目、附件召回及编辑后重新提交。activateSkill.test.ts,覆盖整体准备、参数、实际 steer 结果及inTurn;kap-server API surface 检查保留。replay-adapter.test.ts、replay-resume.integration.test.ts、event-adapter.test.ts。回归覆盖带 part 标记和无 part 标记的旧组合记录,包含行首、正文内、多 Skill、重复提及、图片和视频,以及无激活标记的用户自写 XML。验证结果:
尚未收束:Hook 拒绝的 Skill 不进入实时用户条目,但引擎会保存该尝试,恢复时仍显示原文。需要选择仅在 TUI 恢复时隐藏这类条目,或在实时与恢复界面均保留完整原文并明确标注“被拒绝”。两者都不改变模型上下文或公共协议;本 PR 尚未实施任何一种。摘要顺序的维护者确认仍未取得。
Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.