Skip to content

Windows 开发脚本 spawn EINVAL + thinking 刷新率过高导致闪烁 #234

Open

Description

@Bronya0

What version of Kimi Code is running?

0.6.0

Which open platform/subscription were you using?

win10/opencodeGO

Which model were you using?

deepseek-v4-flash

What platform is your computer?

win10

What issue are you seeing?

描述

在 Windows 上搭建本地开发环境时发现两个小问题:

1. pnpm run dev:cli 报 spawn EINVAL

apps/kimi-code/scripts/dev.mjs 中调用 spawn('tsx.cmd', [...]) 时没有加 shell: true。Windows 上
node_modules/.bin/ 里的 .cmd 文件是批处理脚本,不能直接用 Node.js spawn() 启动,需要通过 cmd.exe
来执行。导致:


Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:441:11)

修复方式:仅在 Windows 上添加 shell: true(POSIX 不需要)。

2. Thinking 内容 50ms 刷新导致闪烁刺眼

STREAMING_UI_FLUSH_MS = 50 意味着 ThinkingComponent 的文本内容在快速流式输出时每秒刷新多达 20 次。live
模式只展示末尾 2 行(尾滚动),快速的原地文本替换会产生频闪效果,长时间观看眼睛容易疲劳。

建议:改为 200ms,每秒 5 次刷新,闪烁基本消除,终端响应感依然流畅。

改动内容

两个修改已实现在 https://github.com/Bronya0/kimi-code,包含以下文件:

 1. **`apps/kimi-code/scripts/dev.mjs`** — Windows 上 spawn `tsx.cmd` 时加 `shell: true`;屏蔽 DEP0190 警告(dev

脚本参数安全)
2. apps/kimi-code/src/tui/constant/streaming.ts — STREAMING_UI_FLUSH_MS 从 50 改为 200

环境

 - 操作系统: Windows
 - Node.js: 24.15.0
 - pnpm: 10.33.0

What steps can reproduce the bug?

修复方式:仅在 Windows 上添加 shell: true(POSIX 不需要)。

2. Thinking 内容 50ms 刷新导致闪烁刺眼

STREAMING_UI_FLUSH_MS = 50 意味着 ThinkingComponent 的文本内容在快速流式输出时每秒刷新多达 20 次。live
模式只展示末尾 2 行(尾滚动),快速的原地文本替换会产生频闪效果,长时间观看眼睛容易疲劳。

建议:改为 200ms,每秒 5 次刷新,闪烁基本消除,终端响应感依然流畅。

改动内容

两个修改已实现在 https://github.com/Bronya0/kimi-code,包含以下文件:

 1. **`apps/kimi-code/scripts/dev.mjs`** — Windows 上 spawn `tsx.cmd` 时加 `shell: true`;屏蔽 DEP0190 警告(dev

脚本参数安全)
2. apps/kimi-code/src/tui/constant/streaming.ts — STREAMING_UI_FLUSH_MS 从 50 改为 200

What is the expected behavior?

No response

Additional information

No response

Activity

  1. Bronya0 commented on May 29, 2026

    @Bronya0
    Author

    PR:#235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions