fix(windows): restart_claude_desktop — remove duplicate pre-lookup taskkill#140
Merged
Conversation
…skkill Codex audit of v0.4.40 → v0.4.46 flagged a regression in `restart_claude_desktop`: a second `taskkill /IM Claude.exe` call has been duplicated *above* the sysinfo lookup that captures the running binary's path. By the time the sysinfo branch ran, Claude was already gone, the lookup returned `None`, and resolution fell through to the hardcoded `%LOCALAPPDATA%` candidates — defeating exactly the MSIX / Store / custom-install coverage we added in PR #128. Fix: drop the leading taskkill block. The post-lookup taskkill that we explicitly placed "after capture" remains, with its existing comment spelling out the ordering contract. A new comment at the top of the block records the history so this regression can't slip back in unnoticed. Verification (macOS arm64): cargo check / clippy `-D warnings` / test --lib (98/98), all clean. No backend behaviour change on Mac. Codex finding reference: SCOPE B / NICE-TO-HAVE / lib.rs:510. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Codex audit of v0.4.40 → v0.4.46 flagged a regression in
restart_claude_desktop: a duplicatetaskkill /IM Claude.exewas added above the sysinfo-based path lookup at some point between v0.4.40 and v0.4.46. That kills Claude before sysinfo can read its executable path, so the lookup returnsNoneand resolution silently falls back to the hardcoded%LOCALAPPDATA%candidates — defeating exactly the MSIX / Store / custom-install coverage we added in PR #128.Removed the duplicate; the single post-lookup taskkill (with its "after capture" ordering comment) remains. New top-of-block comment records the regression so the duplicate can't slip back in.
Why now
Tester is waiting on a fresh NSIS. Without this fix, every Restart-Claude-Desktop click on a Store-installed Claude (or any custom path) falls back to "Claude Desktop nicht gefunden" — even though sysinfo would have seen the right path if the order were preserved.
Test plan
-D warnings/ test --lib (98/98) — clean on macOS arm64🤖 Generated with Claude Code