Repository navigation
feat(tui): sweep running titles toward text and add KIMI_CODE_TUI_ANIMATION_FPS - #4843
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
🦋 Changeset detectedLatest commit: 0404d2b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09ad1d1247
ℹ️ 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.
🟡 Changes recommended
Unresolved issues can make custom light-theme titles fall below required contrast and cause prolonged animation stalls when frame intervals change rapidly.
2 open issues
自定义亮色主题的扫光混色对比度低于 4.5:1 · New 连续切换帧间隔会将下一帧错误推迟过久 · New
What changed in this PR
本 PR 调整 TUI 运行中标题的扫光效果,使暗色和亮色主题都朝正文色变化,并允许用户配置共享动画时钟的帧率。
Changes:
- 调整分组和 Thinking 标题的颜色、扫光节奏及宽度计算,支持多行标题。
- 新增
KIMI_CODE_TUI_ANIMATION_FPS,支持 1–60 的整数,未设置时保留每帧 120ms。 - 补充动画调度、配置和启动接线测试,以及双语文档和 changeset。
| File | Description |
|---|---|
packages/pi-tui/UPSTREAM.md |
说明可变帧间隔的调度契约。 |
packages/pi-tui/test/tui-render.test.ts |
测试帧间隔切换和非法值。 |
packages/pi-tui/src/tui.ts |
暴露帧间隔设置方法。 |
packages/pi-tui/src/animation-frame.ts |
支持运行时调整动画调度间隔。 |
docs/zh/configuration/env-vars.md |
添加环境变量中文说明。 |
docs/en/configuration/env-vars.md |
添加环境变量英文说明。 |
apps/kimi-code/test/tui/kimi-tui-startup.test.ts |
验证启动帧间隔配置生效。 |
apps/kimi-code/test/tui/config.test.ts |
覆盖帧率解析及无效输入。 |
apps/kimi-code/test/tui/components/messages/transcript-container.test.ts |
覆盖标题颜色、节奏、多行扫光和淡出。 |
apps/kimi-code/test/tui/components/messages/thinking.test.ts |
验证 Thinking 标题的扫光和亮色底色。 |
apps/kimi-code/test/cli/run-shell.test.ts |
验证帧间隔传递和启动警告。 |
apps/kimi-code/src/tui/types.ts |
添加帧间隔选项。 |
apps/kimi-code/src/tui/tui-state.ts |
将配置应用到渲染器。 |
apps/kimi-code/src/tui/kimi-tui.ts |
传递启动帧间隔配置。 |
apps/kimi-code/src/tui/constant/rendering.ts |
定义扫光参数和帧率上限。 |
apps/kimi-code/src/tui/config.ts |
解析帧率环境变量并生成警告。 |
apps/kimi-code/src/tui/components/messages/transcript-group.ts |
按分组工作状态初始化扫光。 |
apps/kimi-code/src/tui/components/messages/thinking.ts |
初始化运行态 Thinking 扫光。 |
apps/kimi-code/src/tui/components/messages/running-title.ts |
实现新颜色、周期和显示宽度计算。 |
apps/kimi-code/src/cli/run-shell.ts |
读取帧率配置并合并启动提示。 |
.changeset/tui-animation-fps.md |
记录 CLI 帧率配置功能。 |
.changeset/pi-tui-animation-frame-interval.md |
记录 pi-tui 帧间隔接口。 |
Review effort: Balanced
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bafe08dd0
ℹ️ 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".
* fix(agent-core-v2): truncate oversized skill content (#4834) * fix(kap-server): bind the main agent when a session is created (#4839) * fix(kap-server): bind the main agent when a session is created * fix(kap-server): reject a profile on prompt submissions * fix(kap-server): reject a profile change through the session profile * fix(kap-server): wait for model configuration before binding a new session * fix(agent-core-v2): deduplicate restored task notifications (#4836) * fix(agent-core-v2): deduplicate restored task notifications * chore: add notification replay fix changeset * fix(agent-core-v2): preserve task notifications after prompt-only crashes * fix(agent-core-v2): complete prompts before ending turns * test: align lifecycle snapshots with prompt completion order * fix(agent-core-v2): settle all prompts during turn finalization * fix(kap-server): drop reserved metadata keys from session profile updates (#4842) * fix(kap-server): drop reserved metadata keys from session profile updates * fix(kap-server): keep stored reserved metadata keys on profile updates * docs: split and rewrite the server API reference (#4841) * docs: split and rewrite the server API reference * docs: redirect old server API anchors to the split pages * docs: describe profile metadata as a replacement * docs: mark question responses as answered-only * fix(kap-server): avoid heartbeat timeout after scheduling stalls (#4823) * fix(kap-server): avoid heartbeat timeout reaping after stalls or clock jumps * fix(kap-server): grace heartbeat window for short scheduling stalls * fix(kap-server): treat only clearly late heartbeats as scheduling stalls * fix(kap-server): time heartbeats on a monotonic clock and drain queued input before reaping --------- Co-authored-by: Kimi Code (Grok Bot) <[email protected]> * fix(kap-server): undo a turn only once when requests race (#4846) * docs: describe heartbeat stall handling (#4849) * docs: describe heartbeat stall handling * docs: explain the monotonic clock in the heartbeat notes * fix(agent-core-v2): acquire session lock before loop restoration (#4848) * fix(agent-core-v2): acquire session lock before loop restoration * chore: add session lock lifecycle changeset * fix(agent-core-v2): hold session lock through loop restoration - add an operation-scoped lease to the session run gate - hold it across loop initialization, reset, and pending drains - cover idle timeout and release ordering * fix(agent-core-v2): keep the output of stopped tool calls (#4854) * fix(kap-server): drop the partial reply of a retried step (#4855) * fix(agent-core-v2): dedupe historical tool schemas (#4862) * fix(agent-core-v2): dedupe historical tool schemas * chore: add duplicate tool schema changeset * fix(agent-core-v2): preserve first tool schema declaration * fix(agent-core-v2): remind on changed tool schemas * fix(agent-core-v2): block stale tool schema calls * fix(agent-core-v2): normalize registry schemas in pending checks * fix(agent-core-v2): import registry tool metadata type * fix(agent-core-v2): preserve abort handling during validation * fix(agent-core-v2): refine validation hook preparation * fix(agent-core-v2): make validation hooks synchronous * fix(agent-core-v2): preserve tool result notes on fork (#4867) * fix(agent-core-v2): preserve tool result notes on fork * chore: add fork tool result note changeset * fix(agent-core-v2): scope tool result note restoration to forks * fix(agent-core-v2): normalize inherited tool result notes * fix(agent-core-v2): isolate fork note restoration * feat(tui): sweep running titles toward text and add KIMI_CODE_TUI_ANIMATION_FPS (#4843) (#4870) * chore: sync web dist from code-app (#4871) code-app: 8ab17294e031323186d357d121c5360b8353900e Co-authored-by: kimi-agent-bot <[email protected]> * ci: release packages (#4835) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: sync web dist from code-app code-app: 5835391dac3a2b9e0c65ffbd418f0d6042a7adb2 --------- Co-authored-by: Haozhe <[email protected]> Co-authored-by: qer <[email protected]> Co-authored-by: Kimi Code (Grok Bot) <[email protected]> Co-authored-by: grapedge <[email protected]> Co-authored-by: kimi-agent-bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Requirement or Bug
全屏模式下,折叠分组的摘要标题和 Thinking 标题在运行时有一道扫光。暗色主题下光带朝背景色走,把字压暗,看着不舒服。这个 PR 让光带在两种主题下都朝正文色走,并新增一个环境变量来调整动画帧率。
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
扫光改成从运行中底色扫到正文色
text。暗色主题的底色是textDim;亮色主题是背景色往text走 60%,不到 4.5:1 时继续往text走,白底上是 #767676,对比度 4.54:1。分组结束后标题照旧淡回textDim。节奏改成以分组开始为锚,600ms 后第一次扫,之后每 4s 扫一次,每次 1.6s。光带按标题实际画出的宽度走,展开的多行标题也会扫到每一行。KIMI_CODE_TUI_ANIMATION_FPS设置共享动画时钟的帧率,取 1 到 60,不设时仍是 120ms 一帧。pi-tui 为此新增了TuiBase.setAnimationFrameRate,只收 1 到 60 的整数。text走text走 60%,不到 4.5:1 时继续加深textDim;走 50%textDim离text太近,扫光几乎看不出来;50% 在白底只有 3.32:1,不到亮色文字 4.5:1 的要求建议先看
running-title.ts,它负责颜色和光带位置。再看packages/pi-tui/src/animation-frame.ts里帧率改变后的调度,以及src/tui/config.ts里的环境变量解析。其余是接线、常量、文档和测试。Screenshots / Recordings
画面来自真实运行的 TUI 抓帧,左边是 main,右边是本 PR。
Behavior Changes and Affected Users
textDim提亮到texttextDim,光带变浅textKIMI_CODE_TUI_ANIMATION_FPSapps/kimi-code/src/cli/run-shell.ts在契约文件清单里。它只在交互式 TUI 启动时多读一个环境变量,print 模式走runPrompt,不受影响。CLI 参数、无头输出和已有的环境变量都没有变。测试覆盖:
transcript-container.test.ts和thinking.test.ts。config.test.ts、run-shell.test.ts和kimi-tui-startup.test.ts。packages/pi-tui/test/tui-render.test.ts。验证
apps/kimi-code的test/tui和run-shell测试共 173 个文件、3706 个用例通过,tsc没有报错。KIMI_CODE_TUI_ANIMATION_FPS=60时光带每帧约移动半列;设为abc时启动提示里会出现说明。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.