Skip to content

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

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

Grapedge wants to merge 6 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。
  • 手动投递按队列顺序串行处理。成功前缀移除;明确失败项及后续输入保留,不立即自动重发。附件租约覆盖投递、召回和丢弃;组间上一轮结束后准备失败或请求拒绝,不会把界面留在等待状态。
  • 实时显示与历史恢复使用激活元数据高亮,不从普通历史文本猜测 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 不变。
  • 保留 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 路径使用各自的恢复逻辑 保留失败项、后续输入及附件;空编辑器可用 ↑ 召回,编辑后重新解析 遇到提交或媒体准备错误的 TUI 用户 初次提取或能力校验失败恢复编辑器;已排队输入可修正重试
UserPromptSubmit 拦截技能输入 旧行首独立激活使用 skill_activation 来源,不进入此 Hook;正文内和多 Skill 的 blocked 结果被 SDK 丢弃 统一输入使用 user 来源,经过 Hook;返回 blocked 时 SDK 明确拒绝,TUI 恢复空闲并保留输入和附件 配置该 Hook 的 TUI Skill 用户及调用 Session.promptWithSkills 的 SDK 用户 Hook 仍可阻止执行;未改普通 prompt、外部 activateSkill、klient 或 HTTP 结果契约
媒体参数与队列 行首路径转换媒体参数,普通队列在排空时刷新引用 组合路径继续转换参数中的媒体引用并管理额外租约;排空沿用普通媒体队列政策,不增加模型能力再校验 图片、视频及排队后切换模型的 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 输入的历史媒体缺口
用户 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 的队列 保留原自动队列判断;手动 Ctrl-S 可投递 Skill,仍排除 bash 开启 Tower 或使用 WaitFor 的 TUI 用户 不扩大 Skill 的自动队列投递范围
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 端到端测试。

验证结果:

  • 根类型检查、CLI/SDK 构建、中英文文档构建通过;lint 为 0 errors,保留既有 warnings。

  • 完整测试套件只运行一次:16,826 passed、51 skipped、3 failed。本次改动涉及的测试均通过。

  • 两个未修改的 native release artifact 测试因本机 PATH 缺少 zstd 失败。

  • 一个未修改的 foreground subagent 超时测试在当前代码和基准 5b936697 的 core 代码快照中均独立复现 30 秒超时。

  • 未修改或跳过这些失败用例来获得绿色结果;需要 CI 继续验证。依赖实际服务的 legacy 测试未连接个人服务。

  • Hook 修复的定向回归:SDK 四个测试文件 103 passed;TUI 消息流与键盘两个文件 348 passed。根类型检查通过,lint 仍为 2803 warnings、0 errors。

  • 早期 CI 的 test (3) 曾在 Tower 的两条预期日志顺序断言失败,未修改该测试;提交 95f413f82 的全部已执行 CI 检查通过,Windows 检查按原设置跳过。

  • VS Code 显示修复先运行失败回归,再修复并通过三个相关测试文件,共 62 passed。根类型检查、VS Code 扩展和 Webview 类型检查、扩展构建、文档构建通过;lint 为 2803 warnings、0 errors。

  • 本轮补漏仅修改 TUI Skill 提交方法和其既有消息流测试:TUI/键盘 356 passed;CLI 类型检查、构建和 lint 通过,lint 保留 2803 warnings、0 errors。原 Changeset 不变。

  • Goal 使用实际编辑器、真实本地 SDK/引擎和受控模型响应检查。idle 边界中请求已实际提交;引擎接收后保持既有排队,Goal 仍 active。该检查不代表真人能稳定命中边界,也不保证后台准备耗时不会跨轮。

  • 视频覆盖行首、正文内、多 Skill,提前准备成功、2 秒超时、保留新草稿、召回和附件仅释放一次。没有运行真实剪贴板到远程模型的视频端到端测试。

  • 本轮全仓类型检查两次达到命令时间上限,没有报告类型错误但未完整结束;改动所在 CLI 的独立类型检查通过。完整测试套件没有重跑。

  • 原有 VS Code inTurn 分组和 TUI /undo 显示裁剪问题分别在普通 steer 与旧单 Skill 路径已存在,留待独立修复。没有新增 Goal 全局优先级、Ctrl-S 媒体等待、加载提示或客户端轮次协议。

  • BTW 修复:先运行图片投递失败测试,再修复;四个相关 TUI 测试文件 391 passed,覆盖图片/视频、行首/正文内/多 Skill、2 秒超时、SDK 拒绝后重试、面板关闭以及主会话和 BTW 相同 turnId 的资源隔离。CLI 类型检查、构建通过,lint 保留 2803 warnings、0 errors。

  • 实际编辑器、真实本地 SDK/引擎与受控模型响应的补充检查确认:最终模型请求中存在图片内容,轮次仍属于 BTW。它不等于真实远程模型的视觉理解测试;没有重跑本机完整测试套件。

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: 634970d

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 ✅ Completed 2026-10-11T10:50:20.168560Z 634970d 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@634970d
npx https://pkg.pr.new/@moonshot-ai/kimi-code@634970d

commit: 634970d

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

this.imageStore,
MEDIA_INGESTION_SUBMIT_WAIT_MS,
);
if (ingestionWait !== undefined) await ingestionWait;

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 Guard the media wait against session switches

When a user submits a newly routed leading skill with an uploading video and then runs /new or switches sessions during this added await, the TUI remains idle and permits the switch; after the wait, the code reads the now-current this.session and the reset image store, so the earlier command can be sent to the new session—often with its media placeholder left literal—instead of being cancelled or restored. Capture the originating session and abort/restore if it changes before extraction and dispatch.

AGENTS.md reference: AGENTS.md:L114-L116

Useful? React with 👍 / 👎.

prepared.skills.push({ name: activation.skillName });
continue;
}
const rewrite = rewriteMediaPlaceholders(activation.args, this.imageStore, 'plain');

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 Preserve skill media args across cache-hint session resets

When the cache-expiry dialog intercepts a sole leading skill such as /skill:review [image #1 …] and the user chooses “Start a new session,” createNewSession clears the image store and makeExtractionResendable only rebuilds the prompt parts, clearing the attachment IDs. This newly deferred rewrite therefore cannot resolve the placeholder in the activation arguments, so the model receives the image part but the expanded skill's ARGUMENTS contains the unusable literal placeholder; materialize or preserve the skill-argument media before resetting the session.

AGENTS.md reference: AGENTS.md:L114-L116

Useful? React with 👍 / 👎.

Comment on lines +140 to +143
if (tokens.length === 1 && tokens[0]?.start === 0) {
return {
intent,
activations: [{ skillName: activations[0]!.skillName, args: text.slice(tokens[0].end).trim() }],

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 Preserve literal multiline prompts after leading skill tokens

For an existing input such as /skill:review\nexplain this or /skill:review\texplain this, parseSlashInput previously treated the whole newline/tab-containing name as an unknown command, and the single-token bundle path deliberately fell through to a normal literal message. This new condition instead recognizes the leading token and binds all remaining text as skill arguments, silently expanding a skill for prompts that previously did not activate one, despite the PR declaring the existing argument rules preserved; restrict argument binding to inputs that the leading slash parser actually resolved as a skill.

AGENTS.md reference: AGENTS.md:L98-L100

Useful? React with 👍 / 👎.

skill_name: leading.skillName,
});
}
void host.sendInlineSkillUserInput(text, activations);

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 Revalidate queued video references before skill dispatch

A leading skill with pasted video submitted while another turn or compaction is active now enters the shared prompt queue instead of the old path that immediately copied the video to a durable local cache path. If the queue outlives the daemon upload's expiry, dispatch refreshes only image references and reuses the stale video_url, causing the entire skill request to fail even though its local source could still have been materialized; refresh/re-extract videos at dequeue or preserve the old cache copy when enqueueing. Fresh evidence beyond the earlier immediate-upload issue is that this queue-drain path never calls the expiry check in videoPartForAttachment.

AGENTS.md reference: AGENTS.md:L114-L116

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.

3 participants