kimi-code
kimi-code copied to clipboard
perf: startup does fixed heavy work synchronously (search-index open + full session reconciliation)
Observations (Windows, desktop app, from the global diagnostic log)
Each launch performs fixed-cost work synchronously with no progress feedback:
- Search index open grows with index size. Measured
openMsacross 10 consecutive launches: 1061, 1151, 1282, 1329, 1519, 2179, 2190, 2247, 2348, 2848 (global search: index opened ... openMs=...). - Full session index reconciliation walks every session on every start (
session index reconciliation ... sessions=93; the count was 57 two weeks earlier and 82 after the user archived old sessions). - minidb query-store open on every launch (
minidb query-store opening dir=... shardCount=16).
This user launches the app ~8x/day (131 launches in 16 days), so per-launch overhead is heavily amplified.
Requests
- Open the search index lazily/in the background so first interaction is never blocked on it.
- Make session reconciliation incremental (only changed session dirs) instead of a full walk.
- Surface startup progress (even a single "preparing workspace..." line) so the wait is explainable.
- Related:
[mcp] startup_timeout_msdefaults to 30000, so a hanging HTTP MCP server can delay session readiness by up to 30s with no per-server indication in the UI. Consider lazy connect or a visible per-server status (beyond/mcp).
补充一条来自 Windows Desktop 1.0.4.0 的实测证据:这个问题不仅影响 CLI 启动性能,也会表现为桌面端启动阶段短暂无响应,随后恢复。
环境:
- Kimi Code Desktop 1.0.4.0
- Windows 11 x64,系统构建号 10.0.26200.9457
- 2026-10-07(GMT+8)
现象:
- 启动后窗口暂时无响应,等待一段时间后通常恢复;
- Windows Event Viewer 多次记录
AppHangB1/AppHangTransient; - 本地数据规模:sessions 约 1.8 GB,search-index 约 59 MB,server/events 约 253 MB;
- 历史启动日志中 search-index openMs 曾达到 1061、1519、2179、2348、2848 ms;
- 启动期间 renderer 还出现过会话订阅失败并反复重试:
session event subscribe failed (not_found)。
另外,本机还观察到一次 Renderer 崩溃:
2026-10-07T07:09:57.691Z ERROR [kimi-desktop] browser renderer gone (reason=crashed)
2026-10-07T07:09:57.719Z ERROR [kimi-desktop] renderer process gone (reason=crashed exitCode=-1)
我已尝试清理 Electron 缓存、清除恢复的浏览器标签,并暂时禁用 Cloudbase 插件;缓存从约 504 MB 降至约 149 MB,但启动短暂无响应仍可偶发复现。
建议 Desktop 端也采用这里讨论的方向:将 search-index、query-store、session reconciliation 和 MCP 初始化移到后台/增量执行,避免阻塞主窗口;同时为 renderer 崩溃和 session subscribe retry 增加可见状态。
相关问题:
- Windows bare
npxstdio MCP:#3216 - Desktop renderer crash:#4119