From 6438b7713375b2fb30ff4e6955ac8bbbdd4d84fd Mon Sep 17 00:00:00 2001 From: chuan Date: Wed, 24 Jun 2026 01:29:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=8E=E5=8F=B0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20Start-Process=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=AD=90=E8=BF=9B=E7=A8=8B=E7=BB=A7=E6=89=BF=E7=AE=A1=E9=81=93?= =?UTF-8?q?=E5=8F=A5=E6=9F=84=E9=98=BB=E5=A1=9E=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit start /b 派生的进程会继承 Claude 传给 hook 的 stdout 管道句柄,curl 攥着不放 导致 Claude 读不到 EOF、直到下载完才放行(hook 被卡住)。改用 powershell Start-Process 启动下载,它默认不继承父进程句柄,hook 立即返回、下载后台继续。 --- scripts/notify.cmd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/notify.cmd b/scripts/notify.cmd index 246f394..ef58437 100644 --- a/scripts/notify.cmd +++ b/scripts/notify.cmd @@ -29,7 +29,12 @@ if exist "%LOCK%" call :reclaim rem atomic lock: only the first hook spawns the worker; others fall through and just rem report progress -> no duplicate downloads even when hooks fire concurrently. -mkdir "%LOCK%" 2>nul && start "" /b "%~f0" __download nul 2>&1 +rem +rem must use Start-Process (not `start /b`): a child started by cmd inherits the +rem hook's stdout pipe handle, so Claude won't see EOF until the download ends -> +rem the hook would block. Start-Process spawns WITHOUT inheriting handles, so the +rem hook returns immediately while curl keeps running detached. +mkdir "%LOCK%" 2>nul && powershell -nop -w hidden -c "Start-Process -WindowStyle Hidden -FilePath '%~f0' -ArgumentList '__download'" >nul 2>&1 rem downloaded size so far (from the .partial file), shown as X.X MB set "DLBYTES=0"