You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
摘要
package.json的dev:web脚本固定写成tsx scripts/dev-web.ts --poll,而scripts/dev-web.ts:26-29明确说明该开关只为无 inotify 事件的网络挂载(weka)准备。.agents/notes/implemented/architecture/2026-07-23-client-plugin-loading-model.md:83也把这套轮询记录为刻意的设计。但在普通本地磁盘上它带来三个后果:
--poll写在 npm 脚本里,开发者无法从命令行关闭,只能绕过脚本直接调用tsx scripts/dev-web.ts。复现
然后改动任一
packages/client/*/src/*.ts,观察 tsdown 打印的Rebuilt in ...。对照组(去掉
--poll):pnpm exec tsx scripts/dev-web.ts --skip-build --no-open实测结果
同一台机器、同一份已构建产物,服务就绪后静置 60 秒的 CPU 累计(占单个核的百分比):
--poll(pnpm run dev:web)tsc -b tsconfig.client.json --watchbuild --watchdsh web单包重建延迟:
@deepseek-ai/dsh-client-ui-chat的源文件):--poll下Rebuilt in 44492ms,原生监听下Rebuilt in 354ms--poll采样里其它包:api-session-controller37546ms、ui-schedule37640ms、ui-conversation43349ms、ui-sidebar-documentpreview73221ms(跨包约 35~73s)两种配置下
dsh web的 HTTP 响应都是 ~9ms,服务端不是瓶颈;差异全部来自文件监听方式。建议
本地磁盘是绝大多数贡献者的场景,网络挂载是少数。所以:
dev:web默认用原生监听,轮询改为显式选项(保留--poll,另加dev:web:poll脚本);或--poll可关闭(--no-poll),否则必须绕过 npm 脚本才能拿到可用的重建速度。两种方案都能让本地开发静置 CPU 接近 0、单包重建保持亚秒级,同时不改变 weka 用户的行为。
环境
0.2.2-alpha.2,commitce7073d512package.json:216→"dev:web": "tsx scripts/dev-web.ts --poll";DEFAULT_POLL_INTERVAL = 500(scripts/dev-web.ts:94)D:\...,非网络挂载),24 逻辑核pnpm run build:artifacts生成相关
dev:webwatch 循环的内存/OOM 问题,其中也提到--poll空闲约占 35% 单核;那篇聚焦内存有界,本篇聚焦轮询默认值与重建延迟,不重复。pnpm dev:web在 Node 24.9.0 上崩溃(ERR_INVALID_RETURN_PROPERTY_VALUE);我这边在 24.22.2 上不复现,与本篇的 CPU 问题相互独立。All reactions