Replies: 5 comments
|
我也遇到了,大项目似乎必现 |
|
Verified all three parts of that analysis against source. It is right, and the strongest evidence is that the code documents the cost itself. The three claims, checked
The self-incriminating comment
That skip is an optimization for the second and later runs. It says nothing about the first. On first authorization the ACE does not exist yet, so the apply happens — and "minutes on large workspaces" is the code's own estimate of what that costs. A checkout with So the reported shape matches: stable on first external-tool call in a big project ( Why nothing responds during itThis is the part worth being precise about, because it constrains the fix. The FFI call is synchronous on the main thread, so the event loop is not merely busy — it is stopped. The web page's refresh, the stop button, and the websocket writes are all queued behind a call that is not going to yield until Windows finishes walking the tree. That also means a progress message cannot rescue this. Emitting "granting workspace write access, this may take minutes" before the call looks like the cheap fix, but the main thread blocks immediately afterwards, so the frame never flushes to the browser. The user sees the same dead UI, only now the harness believes it warned them. Anything that reports progress has to come from somewhere other than the thread that is blocked. Which leaves moving the work off the main thread as the only change that actually helps — the FFI call in a worker, with the main loop free to serve the UI and honour a cancel. The One thing worth measuring before designingWhether the cost is the ACE propagation or the enumeration: (Not reproducible on my side at a useful scale, so I have verified the mechanism rather than the timing. If anyone hits it, the useful measurement is wall-clock for the first |
|
I said above I could not supply the timing. I can now — measured it, and it calibrates the problem in a way that is worth knowing before anyone designs a fix. MethodApplied an Result: cost tracks FILE COUNT, and is linear
≈ 0.17 ms per file, clean linear scaling. Structure does not matter. The same 20,000 files spread across 510 directories nested 8 deep took 3,082 ms — no worse than 20 shallow directories. So a real What that means in practiceThe harness checkout on this machine holds 75,004 files (56,632 of them in That reframes the report slightly, and I think usefully:
Why this matters for the fixA 13-second freeze is bad but survivable; a 2-minute freeze is not. Since the cost is linear in file count and the workspace root is what gets the inheritable ACE, the size of the blast radius is entirely determined by what is inside the granted root — which is the argument for scoping the grant rather than only moving it off-thread. Moving it to a worker fixes the UI freeze at every size; scoping it (excluding Both are worth doing, but they are independent, and the off-thread move is the one that makes the tail case tolerable at all. (Caveat: measured on one Windows 11 machine, local SSD, Defender active. Absolute numbers will vary; the linearity and the structure-independence are the parts I would rely on.) |
|
Fixed locally. Two findings from doing it are worth more than the patch, because both are things the obvious approach gets wrong. Making
|
|
Independent reproduction on 0.1.6-alpha.1 (Windows 10 19045, Node v26.3.0) — two additions to the data already in this thread The trigger here is the PTC
Timing through dsh's own FFI path — a script that calls
That is 0.40 ms/file — the same linear shape as the .NET baseline measured above (0.17 ms/file), about 2.4× the absolute value because the FFI path adds the The affected workspace here is a git checkout with 330,091 files counted inside a 100 s cap (counting did not finish), which puts it in the "minutes" tail of that model and matches the >290 s unfinished run I measured against the real directory. Consistent with One detail that may matter for the fix: the exact-ACE skip only fires for an ACE that is both explicit and exactly matching — Status on 0.1.6-alpha.2 (current newest on npm): not fixed. Diff of every package that could carry a fix:
The The workaround also holds for the PTC path. Happy to share the two probe scripts ( (中文摘要:同一 bug 的独立复现 —— 触发工具是 PTC 模式的 |
Uh oh!
There was an error while loading. Please reload this page.
系统环境
nodejs: v24.13.0
npm: 11.6.2
pnpm:10.30.0
model: deepseek-v4-pro
HEAD: 47f9438
渠道: 官网
操作系统: Windows 10 家庭版 19045.6466
复现方式
workspace-write 模式下令其调用外部工具时稳定触发,且无法停止生成,刷新后网页无反应。只能kill强行关闭。
AI 反馈(仅供参考)
All reactions