Skip to content

feat(tui): fold tool calls and thinking into transcript groups in fullscreen - #4618

Merged
Grapedge merged 29 commits into
mainfrom
verb-group
Nov 5, 2026
Merged

Grapedge merged 29 commits into
mainfrom
verb-group

Conversation

@Grapedge

@Grapedge Grapedge commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

fullscreen 模式下,一轮里连续的读文件、搜索、命令和思考会各占一张卡片,长任务把对话挤出屏幕,用户很难看清模型到底做了什么。这个 PR 把连续的工具调用和已结束的思考折成一行摘要,点击就地展开成每项一行的清单,运行中的内容用尾巴显示正在做什么。开启分组后不再合并或截断旧条目,当前这一轮的每一步都能点开看全。同时,运行中的思考改成带扫光和计时的 Thinking 标题(regular 和 fullscreen 都会变),所有转圈图标和扫光改为共用 pi-tui 新增的动画时钟,每秒最多刷新约 8 次。

没有关联 issue。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

核心思路。 fullscreen 的 transcript 容器把连续的工具和思考成员投影成「分组」。收起时一行摘要,运行中的工具立即进组,组下方用尾巴显示正在做的那一项。展开后标题下空一行,每个成员一行(├/└ 在第 1 列,没有状态圆点),点开某一行,详情仍在组内、显示在这一行下面,并去掉与这一行重复的内容。regular 模式、tools = "off" 和不进组的工具(子代理、沟通类)仍是原来的单卡片。分组开启时不做 30 步合并,也不截断旧条目。两个开关(tools、group_thinking)都关掉时,fullscreen 回到原来的布局,包括 30 步合并。

概念 回答什么问题 本 PR 之后
分组(group) 连续的工具和思考怎么在 fullscreen 里显示 一行摘要加可展开的清单;摘要标记统一是 ●
尾巴(tail) 运行中的组现在在做什么 第 1 列的 └ $ ls -la … · 3s,2 秒后才显示计时;点它也能展开
行(row) 展开后的一项 词 + 主体 + 状态后缀,行开头的词加粗,其余 dim
点开的行 想看某一项的完整内容 详情显示在这一行下面,不拆出分组;去掉和这一行重复的内容
点开的思考 进行中被点开的思考结束后怎么显示 留在分组外,标题 ● Thought for Ns 加全文,点任意一行收回分组
动画帧(animation frame) 转圈图标和扫光什么时候刷新 pi-tui 照抄浏览器的 requestAnimationFrame,所有动画共用一个 120 毫秒一拍的时钟
[transcript.group] 怎么配置 tools = "auto" | "explore" | "off"、group_thinking = true | false,也可在 /settings 里设置
flowchart TD
    A[transcript-items: 读每个成员, 产出 label 和 status] --> B[transcript-projection: 把连续成员投影成分组]
    B --> C[transcript-container: 持有展开状态, 处理点击和 ctrl+o]
    C --> D[transcript-group: 按成员数, 是否运行, 是否展开画标题 尾巴 行 详情]
    D --> F[ToolCall 和 Thinking: renderRowDetail 输出去掉重复的详情]
    G[tui config 和 /settings] --> C
    H[pi-tui requestAnimationFrame: 所有动画共用的 120 毫秒时钟] --> D
    H --> I[月亮和点阵图标, 进行中的思考行]
Loading

transcript-items 是唯一知道「一个工具调用在 transcript 里怎么说」的地方:它给每个成员算出 label(词和主体)和 status(运行中、失败、中断、完成加统计)。标题、尾巴和行都读这两个字段,所以统计和失败规则只写在一处,不会在几个渲染点之间漂移。

动画不再各自开定时器。组件在回调里按经过的时间算出这一拍的画面,画面变了才调用 requestRender(),要继续动就再请求下一拍。同一拍里的多次 requestRender() 合并成一次刷新,所以月亮图标和分组扫光同时在动时,每秒仍只刷新约 8 次。

关键决策。

决策 选择 没选 理由
行怎么得到「词」和「主体」 检查器给每个成员产出 label 和 status,分组渲染只读它们 按前缀把尾巴文本拆成词和其余部分 拆前缀需要和生成尾巴文本的逻辑手动同步两份清单
去掉点开后的重复内容 在构建正文的地方用只做转发的 CardOnly 包装「只属于卡片」的部分 在渲染结果上用正则删重复行 哪些部分算重复,写在构建它的那一行旁边
点开一行 详情就地显示在组内(toggleRow) 沿用旧路径:成员点开后拆出分组变成独立卡片 规格要求详情仍在组里,不拆出
点开行与三轮窗口 点开一行不受「最近三轮」限制;ctrl+o 仍只作用于最近三轮 点开也受窗口限制 用户明确点了一行就打开它,保证点了有反应
单项分组展开 同时把它唯一的成员设为展开 只展开分组 第二项加入后,用户正在看的那一行不会跳走
失败的行 类型上用 status 联合,失败的行没有统计 失败时仍写统计 规格:失败的行写 · failed,不写统计;失败和中断的修改不计入标题总和,各行加起来等于标题
被中断的行 dim 的 · interrupted 不标记,或和失败一样标红 和标题上 · N interrupted 的口径一致
配置键 thinking 改名 group_thinking,不留兼容 同时接受旧键 这个配置是本分支新加的,main 上没有
技能激活卡片 工具进组时(tools 不是 "off")隐藏模型触发的卡片 保留卡片 组里的 Load skill x 行说的是同一件事;代价是看不到技能参数预览,平时很少有人看
Show less 展开的组高度超过视口才出现,视口未知时不画 展开后总是出现 规格:不超过一屏就不出现
分组里的浅色文字 Show less 用标题的 textDim;尾巴和计时用主题的暗淡样式,和 Bash 卡片里的命令、shell 的计时一致 自己把 textDim 往背景色混出一个更淡的颜色 混出来的颜色在浅色主题下对白色只有 3.64:1,低于仓库要求的 4.5:1;用主题现成的样式也和 main 一致
很长的一轮 分组开启时显示每一项 用 … N more 收起更早的条目,或给分组加条数上限 目标是点击就能看全当前这一轮;收起的分组本来就短,上限只会多一次点击
底栏 ctrl+o 提示 分组开启时不显示 换成「点击展开」一类的提示 没有合适的表述;以后用悬停效果表示哪里能点
点开的思考结束后 保留 ● Thought for Ns 标题,和单独成组时的标题逐字节相同 只显示全文,不带标题 标题说明这是什么,也是收回分组的点击目标
动画时钟 pi-tui 照抄浏览器的 requestAnimationFrame / cancelAnimationFrame:一次性请求,固定 120 毫秒一拍 每个组件自己 setInterval;按组件登记各自的间隔 各自定时会叠加刷新(分组扫光 50 毫秒加月亮 120 毫秒,实测每秒刷新 27 次);按间隔登记时,15 毫秒和 16 毫秒两个动画会把刷新推到每秒约 62 次并丢帧(模拟)
回调拿到的时间 和 performance.now() 同一个单调时钟 Date.now() 和浏览器一致,看名字就知道怎么用;系统时间会被手动改时间或网络对时拨动
谁触发刷新 回调画面变了才调用 requestRender() 每一拍自动刷新 扫光在标题外的空档、秒数没变的拍都不刷新

阅读指南。 按下面的顺序看:

  1. apps/kimi-code/src/tui/utils/transcript-items.ts:成员的 label、status 和统计规则从这里来。
  2. apps/kimi-code/src/tui/utils/transcript-projection.ts:连续成员如何成组,什么不进组。
  3. apps/kimi-code/src/tui/components/messages/transcript-container.ts:展开状态、toggleGroup/toggleRow、ctrl+o 的新语义。
  4. apps/kimi-code/src/tui/components/messages/transcript-group.ts:标题、尾巴、行、详情的版面和点击区域。
  5. apps/kimi-code/src/tui/components/messages/tool-call.ts、thinking.ts、running-title.ts:行详情去重,以及运行中思考的 Thinking 标题。
  6. apps/kimi-code/src/tui/config.ts、commands/config.ts、dialogs/settings-selector.ts:配置、持久化和 /settings。
  7. packages/pi-tui/src/animation-frame.ts:共用的动画时钟和它的调度规则;再看 moon-loader.ts、transcript-group.ts、thinking.ts 里的 onFrame 怎么用它。

可以略读:theme/ 下的颜色混合、chip.ts/summary.ts/types.ts 的接线、kimi-tui.ts 的参数透传、各测试文件里的辅助函数。

Screenshots / Recordings

分组在 main 上不存在,下面只放改动后。思考标题放前后对比。

收起的分组。 每个分组一行摘要,只有一项且已结束的分组(如 $ ls)直接显示这一项本身。

收起的分组

展开。 标题下空一行,每项一行,行开头的词加粗;点开了 Search、Bash、Edit 三行,详情在行下面,没有重复的 $ 命令、+N -M 路径 和样例文件行。

展开后每项一行

运行中。 依次是:单条命令运行中、跑完、第二条命令运行中且收起、点尾巴展开、这一轮结束。

运行中的尾巴和展开

失败的行。 开头的词标红,后面写 · failed,不写统计,也不计入标题上的 +1。

失败的行

点开过的思考保留标题。 思考进行中被点开的那一段,结束后留在分组外,标题原地变成 ● Thought for 5s,全文留在下面;点它的标题,它收回分组。

点开的思考保留标题,点标题收回分组

思考中的标题(regular 和 fullscreen 都会变)。 改动前是 braille 圆点加 thinking…;改动后是 ● Thinking,圆点和文字带扫光,2 秒后加 · Ns,预览不再以空行结尾。

改动前(regular) 改动后(regular)
改动前的思考中 改动后的思考中

fullscreen 下从思考中到并入分组的五帧:计时出现前、第一段计时中、第一段结束(Thought for 6s)、第二段思考中、并入分组(Thought for 11s, read 1 file)。

fullscreen 思考到并入分组

Behavior Changes and Affected Users

下表相对 main,一行一个。fullscreen 是 tui.toml 里 tui_mode = "fullscreen" 的用户;regular 是默认模式。

Behavior Before After Who relies on the old behavior Escape hatch
fullscreen 默认折叠工具调用和已结束的思考 每个工具调用、每段思考各一张卡片 连续的一串折成一行摘要,点击展开;默认 tools = "auto"、group_thinking = true tui_mode = "fullscreen" 的 TUI 用户(默认配置状态也会变) [transcript.group] 里 tools = "off" 加 group_thinking = false,或 /settings 里 Tool call folding 选 Show every tool call separately 加 Thinking folding 选 Don't fold thinking,恢复原布局
运行中的工具进组 每个运行中的工具是单独的卡片 立即进组;收起时组下方显示尾巴 └ $ … · Ns(2 秒后才有计时),点尾巴展开 fullscreen 下盯着运行中卡片输出的用户 同上;展开分组或点开那一行可看详情
展开样式和点开一行 组内展开后是整张卡片 标题下空一行,每项一行;点开的行在下面显示详情,仍在组内,并去掉与这一行重复的内容(Grep/Glob 的样例行、Edit 的 +N -M 路径、Bash 的 $ 命令);较早轮次的行也能点开 习惯在组内看到完整卡片头的用户 点开行可看详情;两个开关全关恢复卡片
子代理卡片和沟通类工具 单独的卡片 不进组,仍是单独的卡片 无变化(此行说明分支条件新增但不会命中它们) 不需要
ctrl+o 在 fullscreen 下的语义 展开最近三轮窗口内的卡片 窗口内的分组全部展开,且每一行都点开;仍只作用于最近三轮 用 ctrl+o 看全部输出的 fullscreen 用户 关掉分组后 ctrl+o 与原来一致
很长的一轮 30 步合并 分组开启时不合并、不截断,每一项都在;收起的分组点开就能看全 依赖 30 步合并显示的 fullscreen 用户 两个开关全关恢复 30 步合并
底栏的 ctrl+o 提示 fullscreen 底栏固定显示 ctrl+o expand / ctrl+o collapse 分组开启时不显示;ctrl+o 本身照常可用 fullscreen 用户 关掉分组后恢复;regular 不变
进行中被点开的思考 结束后是一张显示全文的卡片 结束后留在分组外,标题原地变成 ● Thought for Ns,下面是全文;点任意一行收回分组 fullscreen 用户 group_thinking = false
动画的刷新节奏(regular 和 fullscreen) 月亮 120 毫秒、点阵 80 毫秒,各自一个定时器 共用 120 毫秒一拍的时钟;点阵从每秒 12.5 帧变成 8.3 帧;画面没变的拍不刷新 所有 TUI 用户 无;动画按经过的时间计算,扫光速度不变
ctrl+o 遇到模型加载的技能卡(regular 和 fullscreen) 每张技能卡都算一轮的开始,一轮里加载几个技能后,ctrl+o 展开不到最新的内容 不再算作一轮的开始 无(修复) 不需要
组高度超过视口 无此元素 展开的组高过视口才在末尾出现 └ Show less,点它收起并底部锚定 无(新增) 不需要
模型触发的技能激活卡片 模型调用 Skill 工具或嵌套技能后,出现 ▶ Activated skill: x 卡片,并把后面的调用切成新分组 工具进组时(tools 不是 "off")不显示这张卡片,组里的 Load skill x 行代替;它也不再切断分组。看不到技能参数预览 fullscreen 下想看技能参数预览的用户 tools = "off" 恢复;regular 模式和用户 /skill:foo 触发的激活不变
运行中的思考标题(regular 和 fullscreen) braille 圆点加 thinking… ● Thinking,圆点和文字带扫光,2 秒后加 · Ns;下方斜体预览保持,但不再以空行结尾 regular 和 fullscreen 的所有 TUI 用户,包括用截图或文本匹配该标题的外部脚本 无;思考结束后的渲染不变,仅改进行中的标题
已结束的思考 单独一张 Thought for Ns 卡片 fullscreen 且 group_thinking = true 时并入分组;regular 和 group_thinking = false 不变 fullscreen 用户 group_thinking = false
/settings 新增两项 无 fullscreen 下出现 Tool call folding 和 Thinking folding;regular 下不显示 无(新增) 不需要
tui.toml 新增 [transcript.group] 无该节 tools 和 group_thinking;默认值时写成注释,非默认值时写出实节;tools 写错值时警告并回落到默认 已有 tui.toml 的用户(不写该节即用默认,即分组开启) 见第一行
底栏提示 无 fullscreen 且分组开启时,提示轮播新增 click a group summary to reveal every tool call fullscreen 用户 关掉分组后不出现
前台 Bash 的活动行提示 跑满 10 秒后无变化 分组开启时,前台 Bash 跑满 10 秒,活动行提示换成 Press Ctrl+B to run in background fullscreen 用户 关掉分组后无此提示
埋点 无 新增 transcript_group_toggle、transcript_expand_all、transcript_display_settings(group_tools、group_thinking、source) 消费 TUI 埋点的人 不需要
regular 模式的其余部分、tools = "off" 的单卡片、running 2 commands 的摘要写法、进行中的思考显示在组外、标题运行中的扫光 见左 不变
print 模式、ACP、SDK、desktop 与 web、VS Code None:改动只在 apps/kimi-code/src/tui/,未动 src/cli/、契约文件或 kap-server

受影响模块。 所有改动在 apps/kimi-code,另有 docs/ 下中英两份 tui.toml 配置说明。新增的 @moonshot-ai/tree-sitter-bash 是开发依赖,构建时打进产物,用于判断 tools = "explore" 下哪些命令是只读的。

每行对应的测试
行 测试
折叠、尾巴、展开样式、点开一行、每一项都可见、Show less、ctrl+o、点开的思考保留标题、失败和中断 test/tui/components/messages/transcript-container.test.ts、test/tui/utils/transcript-projection.test.ts、test/tui/kimi-tui-message-flow.test.ts、test/tui/components/messages/tool-call.test.ts
技能激活卡片隐藏 test/tui/components/messages/transcript-container.test.ts、test/tui/kimi-tui-message-flow.test.ts、test/tui/message-replay.test.ts
运行中的思考标题 test/tui/components/messages/thinking.test.ts、test/tui/kimi-tui-message-flow.test.ts
配置、/settings test/tui/config.test.ts、test/tui/commands/transcript-preferences.test.ts、test/tui/components/dialogs/mermaid-preference-selector.test.ts
底栏提示、分组开启时不显示 ctrl+o 提示、Ctrl+B 提示 test/tui/components/chrome/footer.test.ts、test/tui/kimi-tui-message-flow.test.ts
动画时钟的调度规则 packages/pi-tui/test/tui-render.test.ts
月亮和点阵图标、分组扫光、思考行扫光改走时钟 test/tui/components/chrome/moon-loader.test.ts、test/tui/components/messages/transcript-container.test.ts、test/tui/components/messages/thinking.test.ts
explore 的只读命令判断 test/utils/readonly-bash.test.ts
两个开关全关恢复原布局 test/tui/fullscreen-layout.test.ts、test/tui/components/messages/transcript-container.test.ts

验证。 TUI 测试全绿,打包后的清单里没有私有包。在真实程序里恢复同一批真实会话的副本,逐页对比 regular 模式和关闭分组时的整个对话,和 main 没有差异(只差底栏轮播的提示)。

性能。 低速模式(macOS 后台优先级 taskpolicy -c background,模拟较慢的机器),fullscreen 默认配置:

场景 main 本 PR
约 30 步的会话,工具运行时每秒刷新 8.3 8.3
同上,处理器占用(各 4 次的中位数) 3.65% 4.0%
同一会话,思考时每秒刷新 13.3 9.3
同上,处理器占用(各 2 次) 3.6%、4.3% 4.0%、4.3%
约 480 步的会话,按 ctrl+o 展开后打字回显 5.1 ms 18.2 ms

统一时钟之前,本分支工具运行时每秒刷新 26.9 次,处理器占用 9.7%。ctrl+o 展开大量输出后的打字延迟来自 main 上就有的重复计算,堆叠在本 PR 上的修复 #4665 把它降到 5.1 ms。在真实的 kimi 程序里手动验证过 fullscreen 下的分组展开和收起、点开一行、失败的行、运行中的尾巴和思考标题。regular 模式的思考标题用接生产组件的演示脚本验证。开 PR 前的复核发现已在本 PR 中修掉。

未单独验证的部分
  • 截图只覆盖 light 主题;主题切换相关改动见 test/tui/terminal-theme.test.ts。
  • 埋点字段只由测试断言,没有在真实上报链路里核对。
  • tools = "explore" 的只读命令判断带解析预算(500 ms、20,000 节点),预算耗尽时的降级行为只由 test/utils/readonly-bash.test.ts 覆盖。

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.

@changeset-bot

changeset-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 31067c9

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

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/kimi-code Minor
@moonshot-ai/pi-tui 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 Nov 2, 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-11-04T14:53:04.591106Z 31067c9 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 Nov 2, 2026 •

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

commit: 31067c9

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

ℹ️ 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 Resolved
Comment thread apps/kimi-code/src/tui/tui-state.ts Resolved
@Grapedge
Grapedge added this pull request to stack #4619 November 2, 2026 15:52
Copilot AI balanced review requested due to automatic review settings November 3, 2026 19:46

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.

🟡 Changes recommended

Truncated tool calls can be reported as completed edits, and skill activations can corrupt transcript trimming, alongside unresolved accessibility and follow-mode regressions.

7 open issues
1 file not reviewed
  • pnpm-lock.yaml: Generated file
What changed in this PR

This PR groups consecutive tool calls and completed thinking in the fullscreen TUI, and updates the running thinking display.

Changes:

  • Add expandable transcript groups, display settings, and read-only Bash classification.
  • Introduce shared animation-frame scheduling for TUI animations.
  • Update tests, configuration documentation, and changesets.

This pull request requires changes.

File Summary
pnpm-lock.yaml Records the Bash parser dependency.
packages/​pi-tui/​UPSTREAM.md Documents the animation-frame extension.
packages/​pi-tui/​test/​tui-render.test.ts Tests animation-frame scheduling.
packages/​pi-tui/​src/​tui.ts Integrates animation frames with the TUI lifecycle.
packages/​pi-tui/​src/​index.ts Exports the animation-frame API.
packages/​pi-tui/​src/​animation-frame.ts Implements the shared scheduler. [P2] Pausing during a callback still drains remaining callbacks.
docs/​zh/​configuration/​config-files.md Documents grouping settings in Chinese.
docs/​en/​configuration/​config-files.md Documents grouping settings in English.
apps/​kimi-code/​test/​utils/​readonly-bash.test.ts Tests read-only command classification.
apps/​kimi-code/​test/​tui/​terminal-theme.test.ts Tests grouping colors.
apps/​kimi-code/​test/​tui/​signal-handlers.test.ts Updates configuration fixtures.
apps/​kimi-code/​test/​tui/​message-replay.test.ts Adapts replay and expansion-state tests.
apps/​kimi-code/​test/​tui/​kimi-tui-startup.test.ts Updates startup configuration fixtures.
apps/​kimi-code/​test/​tui/​fullscreen-layout.test.ts Tests scroll anchoring and settings layout.
apps/​kimi-code/​test/​tui/​create-tui-state.test.ts Updates transcript-container state assertions.
apps/​kimi-code/​test/​tui/​config.test.ts Tests grouping configuration parsing and persistence.
apps/​kimi-code/​test/​tui/​components/​messages/​tool-call.test.ts Adapts tool-call timing tests.
apps/​kimi-code/​test/​tui/​components/​messages/​thinking.test.ts Tests thinking titles and animation.
apps/​kimi-code/​test/​tui/​components/​messages/​agent-group.test.ts Adapts tool-result timing tests.
apps/​kimi-code/​test/​tui/​components/​dialogs/​mermaid-preference-selector.test.ts Tests grouping settings selectors.
apps/​kimi-code/​test/​tui/​components/​chrome/​welcome.test.ts Updates configuration fixtures.
apps/​kimi-code/​test/​tui/​components/​chrome/​moon-loader.test.ts Tests shared-frame loading animation.
apps/​kimi-code/​test/​tui/​components/​chrome/​footer.test.ts Tests grouping hints.
apps/​kimi-code/​test/​tui/​components/​chrome/​footer-status-line.test.ts Updates configuration fixtures.
apps/​kimi-code/​test/​tui/​commands/​update-preferences.test.ts Updates configuration fixtures.
apps/​kimi-code/​test/​tui/​commands/​transcript-preferences.test.ts Tests grouping preferences and telemetry.
apps/​kimi-code/​test/​tui/​commands/​reload.test.ts Adapts configuration reload tests.
apps/​kimi-code/​test/​tui/​activity-pane.test.ts Updates configuration fixtures.
apps/​kimi-code/​test/​cli/​update/​preflight.test.ts Updates configuration fixtures.
apps/​kimi-code/​src/​utils/​readonly-bash.ts Classifies read-only Bash commands. [P2] git remote -v remove origin, attached sed -e scripts, and bare numeric redirect destinations can be misclassified as read-only.
apps/​kimi-code/​src/​tui/​utils/​transcript-turns.ts Identifies turn boundaries. [P1] Model-loaded skill cards can create incorrect boundaries and leave trimmed turns out of sync.
apps/​kimi-code/​src/​tui/​utils/​transcript-projection.ts Projects transcript members into groups. [P1] Dense segments lack the promised expandable … N more and visible-item limit.
apps/​kimi-code/​src/​tui/​utils/​transcript-items.ts Extracts member labels, statuses, and statistics. [P1] Truncated, unexecuted calls can be reported as successful edits. [P2] Standalone model-triggered skill activations can be hidden without a matching tool call.
apps/​kimi-code/​src/​tui/​utils/​component-capabilities.ts Adds row-detail capability detection.
apps/​kimi-code/​src/​tui/​types.ts Adds grouping configuration and timing types.
apps/​kimi-code/​src/​tui/​tui-state.ts Integrates the transcript container and view.
apps/​kimi-code/​src/​tui/​theme/​theme.ts Provides grouping colors. [P2] The light-theme mixed foreground falls below the required text contrast ratio.
apps/​kimi-code/​src/​tui/​theme/​gradient-text.ts Reuses color-mixing utilities.
apps/​kimi-code/​src/​tui/​theme/​color-mix.ts Adds color parsing and mixing.
apps/​kimi-code/​src/​tui/​controllers/​subagent-event-handler.ts Removes components through the container.
apps/​kimi-code/​src/​tui/​controllers/​streaming-ui.ts Integrates grouping state and timing.
apps/​kimi-code/​src/​tui/​controllers/​session-replay.ts Adapts replay to container state.
apps/​kimi-code/​src/​tui/​controllers/​session-event-handler.ts Adapts container expansion and replacement.
apps/​kimi-code/​src/​tui/​constant/​tips.ts Adds grouping hints.
apps/​kimi-code/​src/​tui/​constant/​rendering.ts Adds grouping animation and timing constants.
apps/​kimi-code/​src/​tui/​config.ts Defines and persists grouping configuration.
apps/​kimi-code/​src/​tui/​components/​messages/​transcript-view.ts Adds scroll anchoring. [P1] Group interactions disable follow-end even when the viewport was already following.
apps/​kimi-code/​src/​tui/​components/​messages/​transcript-group.ts Renders groups and handles interactions. [P1] Older groups and member details have no keyboard expansion path.
apps/​kimi-code/​src/​tui/​components/​messages/​transcript-container.ts Manages projections and expansion state. [P2] Ctrl+O changes manually expanded content outside its three-turn window. [P2] A running group can lose its active tail and animation when later content appears.
apps/​kimi-code/​src/​tui/​components/​messages/​tool-renderers/​types.ts Adds card-only content wrapping.
apps/​kimi-code/​src/​tui/​components/​messages/​tool-renderers/​summary.ts Avoids duplicated row-detail summaries.
apps/​kimi-code/​src/​tui/​components/​messages/​tool-renderers/​chip.ts Shares tool statistics text.
apps/​kimi-code/​src/​tui/​components/​messages/​tool-call.ts Supports grouping details and timing.
apps/​kimi-code/​src/​tui/​components/​messages/​thinking.ts Updates thinking titles and row details.
apps/​kimi-code/​src/​tui/​components/​messages/​skill-activation.ts Identifies model-triggered skill activations.
apps/​kimi-code/​src/​tui/​components/​messages/​running-title.ts Implements title shimmer and timing.
apps/​kimi-code/​src/​tui/​components/​messages/​read-group.ts Exposes members and projection versions.
apps/​kimi-code/​src/​tui/​components/​messages/​assistant-message.ts Tracks projection-related changes.
apps/​kimi-code/​src/​tui/​components/​messages/​agent-swarm-progress.ts Tracks projection-related state.
apps/​kimi-code/​src/​tui/​components/​messages/​agent-group.ts Tracks group projection versions.
apps/​kimi-code/​src/​tui/​components/​dialogs/​settings-selector.ts Adds grouping settings.
apps/​kimi-code/​src/​tui/​components/​chrome/​moon-loader.ts Uses shared animation frames.
apps/​kimi-code/​src/​tui/​components/​chrome/​footer.ts Shows grouping-related hints.
apps/​kimi-code/​src/​tui/​commands/​undo.ts Removes undone content through the container.
apps/​kimi-code/​src/​tui/​commands/​reload.ts Reloads grouping configuration.
apps/​kimi-code/​src/​tui/​commands/​config.ts Applies and saves grouping settings.
apps/​kimi-code/​package.json Adds the Bash parser development dependency.
.changeset/​tidy-transcript-groups.md Records fullscreen grouping changes.
.changeset/​pi-tui-animation-frames.md Records the animation-frame API.
.changeset/​live-thinking-title.md Records the thinking-title change.
.changeset/​hide-ctrl-o-hint-while-grouping.md Records footer hint changes.
.changeset/​ctrl-o-skill-card-turns.md Records the Ctrl+O turn-boundary change.

Review effort: Balanced

Comment thread apps/kimi-code/src/tui/theme/theme.ts Resolved
Grapedge added a commit that referenced this pull request Nov 4, 2026
Base automatically changed from fix-search-glance-indent to main November 4, 2026 06:03

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

ℹ️ 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: ad3df8295d

ℹ️ 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 Resolved
…lscreen

In fullscreen mode, consecutive tool calls and finished thinking now fold
into one summary line that expands in place on click. Running tools join
the group right away, and an open group shows what it is doing on a tail
line. Subagent cards and communication tools stay outside groups. Long
runs between replies collapse older items behind a "… N more" row.

Configure it under [transcript.group] in tui.toml (tools = "auto" |
"explore" | "off", thinking = true | false) or with the Tool grouping and
Group thinking entries in /settings, which appear only in fullscreen.
Turning both off restores the previous fullscreen layout, including the
30-step merge. Regular mode is unchanged.

A foreground Bash call running for 10 seconds also replaces the activity
line tip with a Ctrl+B hint while grouping is on.
…king

[transcript.group] now reads group_thinking = true | false, matching the
group_thinking telemetry field and the Group thinking setting.
Each grouped item now carries its verb, subject, and finished status
(running, failed, interrupted, or done with a stat) instead of a joined
tail string, so a group can lay out rows from data. Cards mark the parts
a group row repeats (search samples, the Edit diff header, the Bash
command) and render a row detail without them.
Every group title now uses the same dot marker. An expanded group lists
one row per item without line counts: a bold verb, its subject, and a
diff, search count, running timer, or failed/interrupted note. Clicking
a row opens its detail in place, inside the group, without the parts the
row already says. A finished one-item group is titled by the item
itself, and Show less only appears once an expanded group is taller than
the transcript viewport. The collapsed tail now starts at column one.
When tool calls are grouped, the extra Activated skill card for a model-triggered skill no longer appears after the group or splits it. User /skill activations and ungrouped transcripts are unchanged.
Live thinking now shows a `● Thinking` title with the same moving highlight
as running transcript groups and an elapsed-seconds timer after two seconds,
instead of the braille spinner and `thinking…`. The preview under it no
longer ends with a blank row.
A thought opened while it was streaming now stays between the tools that ran before and after it. The group around it splits in two until the thought is collapsed again.
Ctrl+O no longer treats skill cards loaded by the model as the start of a turn, so after several skill loads it still expands the latest turns, in both fullscreen and regular mode.
With transcript grouping on, a long run of tool calls no longer hides its
older groups and cards behind a clickable "… N more" row. Every group and
card in the turn stays in the transcript, so a click can open any of them.
With grouping on, the footer no longer shows "ctrl+o expand" or
"ctrl+o collapse"; ctrl+o itself still expands and collapses. Regular
mode and fullscreen with grouping off keep the hint.
The TUI now offers requestAnimationFrame and cancelAnimationFrame. A
request runs once, every callback of a frame gets the same timestamp on
the performance.now() clock, and frames land on a fixed 120 ms grid
served by one unref'd timer that exists only while a request is pending.
A throwing callback does not stop the others; the first error is
rethrown in a microtask. stop() pauses frames and start() resumes on the
next frame without replaying missed ones. TuiBase takes an optional
clock so tests can drive frames by hand.
The activity spinner, transcript group titles, and the live Thinking line
now advance only on the TUI's 120 ms animation frames and request a
render only when what they draw changes. Renders between frames, such as
typing, no longer move the highlight, and the highlight requests no
renders while it waits off the title. The braille spinner now turns at
120 ms per frame, like the moon.
With transcript grouping on, a thought the user clicked open while it
streamed stays outside its group once it finishes, but it lost its
title and fell back to the old bulleted first line. It now keeps a
"Thought for Ns" title, drawn exactly like the title of a one-item
group, above its full text.

A click on any line of such a thought now always folds it back into
its group. Before, a thought of three lines or fewer had nothing
hidden once it finished, so the click was ignored.

Regular mode, fullscreen with grouping off, and fullscreen with
thinking left out of grouping keep the old finished form and the old
click handling.
While the highlight waits off a running title it requests no renders, but
the title width it compared against only ever grew. After a group title got
shorter, such as a long command title turning into "Ran 2 commands", or
after a wrapped command title closed, the highlight requested a render on
every frame although nothing on screen changed. Each title render now
starts a new measurement, so the gap check uses the columns of the title
shown now.
Closing an opened thought folds it back into one group with the groups
around it, and the merged group stays expanded when one of them was. The
expanded flag was written to the anchor the code guessed for the merged
group. When a silent tool call such as select_tools came right before the
thought, the merged group started at that call instead, so the group the
user had just expanded showed up collapsed. The container now projects
the transcript again after the close and marks the group that actually
holds the closed item.
The title highlight eased toward on or off by a fixed share of the gap on
every animation frame, so a longer frame made it fade faster: on 120 ms
frames it faded out in about 840 ms instead of the second it took on the
50 ms frames it was tuned on. It now closes half of the remaining gap
every 150 ms of elapsed time, which keeps the 50 ms speed (within 0.005
of that curve) on any frame length.
The spinner test waited a hard-coded 119, 1 and 120 ms, which only lines
up with 120 ms animation frames. It now derives when each spinner frame
shows from the spinner frame duration and the animation frame interval,
so changing the frame interval alone leaves the test passing.
The animation frame timer is unref'd so a frame that keeps requesting the
next one never holds the process open, but no test covered it. The new
test runs a child process whose frame callback requests another frame
forever and checks that the child runs frames, then exits on its own.
The transcript group changeset carried a second sentence about the footer
hint. A changeset states one change, so the group entry goes back to its
own sentence and the hint gets a patch entry that names what users lose
and how to bring the hint back.
Clicking a group title, its tail or one of its rows pinned the scroll
position so the clicked line stayed put. While the transcript was
following its end, that pin also turned following off, so later tool
output and the final reply landed below the screen behind "Jump to
bottom". While the transcript follows its end, a click now toggles the
group without pinning, as Show less and clicks on ungrouped cards already
do. A transcript that is scrolled up still keeps the clicked line in
place.
… created with

The default animation clock looked up the global setTimeout and
performance.now on every frame. When an earlier test left a frame chain
running on real timers and its next frame fired after a later test had
called vi.useFakeTimers(), the chain moved onto the fake timers and kept
going, so vi.runAllTimersAsync() in that test aborted after 10000
timers. The race depends on timing, which made the TUI message flow
tests fail only now and then on CI. Production code never swaps the
timers.

Each scheduler now binds the timers and performance.now it finds when it
is created. A scheduler created on real timers stays on them, and one
created after vi.useFakeTimers() still runs on the fake timers, so
existing component tests keep working unchanged.
…lded Bash calls

A foreground Bash command that runs for 10 seconds advertises "Press
Ctrl+B to run in background". With transcript folding on, the activity
line showed it for every running command, so a command drawn as its own
card showed the hint twice, and opening a folded group exposed the
card's own copy next to the activity line's.

The activity line now shows the hint only for a running Bash call that
is folded into a group. Such a call is one the folding settings cover
and the user has not opened as a card. The transcript container decides
this from the call alone, without projecting the transcript, because the
activity line refreshes on every replayed step. Projecting there would
set the ctrl+o expansion of each replayed group before the replay knows
the last three turns, and would cost a full projection per step.

The card keeps its hint for the standalone card form, so group row
details no longer draw it. The activity line also refreshes when a call
moves between a card and a group: a settings change, opening or closing
a card, ctrl+o, and the start of a command whose argument preview was
folded. With only read-only tools folding, every preview folds, and the
started command may turn out not to be read-only.
@Grapedge
Grapedge merged commit e6ae8ed into main Nov 5, 2026
16 checks passed
@Grapedge
Grapedge deleted the verb-group branch November 5, 2026 04:10
@XRX193 XRX193 mentioned this pull request Nov 6, 2026
5 tasks done
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 15, 2026
The --verify test probes ran bun test from the repository root, so apps/kimi-code/bunfig.toml never loaded its preload and the app's imports map was not the active one; the KIMI_LANG default fell back to the host locale and the MoonshotAI#4618 case failed on an English string. Resolve the probe file against the repository root, pick the nearest ancestor package.json as the working directory, and pass the path relative to it, matching how scripts/run-tests.mjs spawns each package suite.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 15, 2026
…hotAI#4755 evidence

MoonshotAI#4618 is configured through [transcript].tool_call_density and [transcript].thinking, not a [transcript.group] table. The MoonshotAI#4618 probe limitation and the four-file hang noted on MoonshotAI#4755 were fixed in 580b5b5 and 4d88e05. MoonshotAI#4730 was recorded as no longer reconstructing step ids, which the step.begin case still does; the real gap was the live context-memory fold dropping the recorded content-part timing, now fixed in 008fb38. Verdicts are unchanged.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 15, 2026
…t type

MoonshotAI#4618 added mixColors and colorDistance plus the Theme terminalBackground fallback without the tests that pin their values, so a later change to either helper would go unnoticed; add the upstream assertions for the mixes, the distance and both palette families. Instant went back to a branded number, matching the upstream type so a raw number cannot stand in for a monotonic instant; the affected fixtures wrap their literals in instant() without changing what they assert.
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