MoonshotAI / MoonshotAI/kimi-code

AskUserQuestion 支持为已选选项补充备注

Open
#3,497 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

你希望看到什么功能?

希望 Kimi Code TUI 的 AskUserQuestion 支持“选择预设选项并补充说明”。

当前问题

现在单选问题只能:

  1. 选择一个预设选项;或
  2. 选择 Other 并输入完全自定义的回答。

但实际场景中,某个预设选项经常只符合用户的部分意图。

例如,当 Agent 询问是否关闭 Heartbeat 时,用户可能总体同意 Disable it (Recommended),但还想补充:“先关闭,但保留配置;以后有周期任务时再重新启用。”

目前选择预设选项会丢失补充条件;选择 Other 又会丢失明确的结构化选择。Agent 因此无法同时获得“用户选择了什么”和“用户如何修正或限定这个选择”。

建议交互

在不影响现有快速选择流程的前提下,增加可选备注:

  • Enter 或数字键:保持现有行为,直接选择当前选项。
  • Tab:选择当前高亮的预设选项,并打开行内 Comment: 输入框。
  • Enter:保存备注并继续。
  • ←/→:继续用于切换问题或 Submit 页。
  • Review 页面同时展示已选选项和备注。
  • Other 保持现有自由回答行为。

示例:

→ [1] Disable it (Recommended)
      Comment: Disable it for now, but keep the configuration so it can
               be enabled again when periodic tasks are added.
返回给 Agent 的结果

可以保持现有字符串答案协议,只在用户填写备注时同时返回两部分信息:

{
  "answers": {
    "Given that, disable the heartbeat or give it something to do?": "Selected: Disable it (Recommended)\nComment: Disable it for now, but keep the configuration so it can be enabled again when periodic tasks are added."
  }
}

没有备注时,仍返回原来的选项标签,保持向后兼容:

{
  "answers": {
    "Given that, disable the heartbeat or give it something to do?": "Disable it (Recommended)"
  }
}
期望结果
  • 用户可以保留最接近其意图的预设选项,同时补充限制条件或细节。
  • Agent 明确获得所选选项和用户备注,不需要猜测二者之间的关系。
  • 不增加普通选择的操作步骤。
  • 不改变现有 Other、数字键选择和直接确认行为。
  • 本建议首先只覆盖终端 TUI。
补充信息

官方文档说明 AskUserQuestion 会自动追加 Other,但目前没有“预设选项 + 补充备注”的交互:https://github.com/MoonshotAI/kimi-code/blob/main/docs/en/reference/tools.md

相关但不同的 Issue:#2566 讨论的是 ACP 客户端缺少 Other 输入能力;本建议讨论的是 TUI 中为已选预设项追加说明。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TUI AskUserQuestion implementation and its existing Other, numeric-selection, review, and answer-serialization paths; the documentation reference is docs/en/reference/tools.md. Add optional comments for preset selections without changing direct selection, Other, or backward-compatible answers, and verify that review and returned answers show the selection and comment correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.