| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(update): align lifecycle semantics and close lock-identity gaps A failing gc command skipped the update lifecycle entirely on the bootstrap channel (cobra skips PersistentPostRun when RunE errors), while the npm wrapper runs its lifecycle on every exit code: pending summaries, first-run notice and due background checks all stalled while a user's commands kept failing (e.g. an expired token). Execute now runs the lifecycle explicitly on the error path, mirroring gc.js. A background spawn that raced a mode flip to off still installed on the npm channel (shouldOnlyNotify has no off branch); the under-lock mode recheck now returns disabled for background runs — writing no state, so the winner's nextCheck stays put. updateMode trims whitespace on both JS channels (CRLF-contaminated profile values like " off" resolved differently than the Go side, which trims). A transient bootstrap failure over an existing permanent pause now says the pause remains (mirroring the npm channel's sticky guidance). Lock identity: the JS releaseLock's inode check always passes on Windows (libuv leaves st_ino at 0), so a stalled holder resuming after a stale reclaim would still delete the reclaimer's fresh lock there — the locks now record the holder pid and release verifies it by content (the Go side already did), keeping the inode check as the POSIX fast path. The stale-reclaim restore path used rename, which silently overwrites: a third process claiming the freed path between the retire and the restore would have its fresh lock clobbered; the restore now uses link+unlink (EEXIST means the path is taken — give up the hold) on all three implementations. writeState failures no longer vanish silently: mutateStateLocked reports them, and the hourly spawn backoff degrades to a single fixed "state is not writable" notice instead of reprinting the spawn detail on every command. Fifth review P3 backlog, issue 607 items 11, 12, 13, 14, 15, 17, 18. Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 | |
fix(update): align lifecycle semantics and close lock-identity gaps A failing gc command skipped the update lifecycle entirely on the bootstrap channel (cobra skips PersistentPostRun when RunE errors), while the npm wrapper runs its lifecycle on every exit code: pending summaries, first-run notice and due background checks all stalled while a user's commands kept failing (e.g. an expired token). Execute now runs the lifecycle explicitly on the error path, mirroring gc.js. A background spawn that raced a mode flip to off still installed on the npm channel (shouldOnlyNotify has no off branch); the under-lock mode recheck now returns disabled for background runs — writing no state, so the winner's nextCheck stays put. updateMode trims whitespace on both JS channels (CRLF-contaminated profile values like " off" resolved differently than the Go side, which trims). A transient bootstrap failure over an existing permanent pause now says the pause remains (mirroring the npm channel's sticky guidance). Lock identity: the JS releaseLock's inode check always passes on Windows (libuv leaves st_ino at 0), so a stalled holder resuming after a stale reclaim would still delete the reclaimer's fresh lock there — the locks now record the holder pid and release verifies it by content (the Go side already did), keeping the inode check as the POSIX fast path. The stale-reclaim restore path used rename, which silently overwrites: a third process claiming the freed path between the retire and the restore would have its fresh lock clobbered; the restore now uses link+unlink (EEXIST means the path is taken — give up the hold) on all three implementations. writeState failures no longer vanish silently: mutateStateLocked reports them, and the hourly spawn backoff degrades to a single fixed "state is not writable" notice instead of reprinting the spawn detail on every command. Fifth review P3 backlog, issue 607 items 11, 12, 13, 14, 15, 17, 18. Co-Authored-By: Claude Code <noreply@anthropic.com> | 1 个月前 |