fix: resolve dependencies via registry Machine/User PATH on Windows(#504) - #661
Merged
carlospedreira merged 3 commits intoAug 3, 2026
Conversation
carlospedreira
force-pushed
the
bugfix/split-path-preflight-repro-tests
branch
from
August 3, 2026 09:29
319c1f6 to
869f016
Compare
carlospedreira
force-pushed
the
bugfix/split-path-preflight-repro-tests
branch
from
August 3, 2026 10:13
869f016 to
8076456
Compare
carlospedreira
approved these changes
Aug 3, 2026
carlospedreira
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the rebased final head. PATH repair opt-out, split-PATH doctor behavior, deterministic scope/elevation coverage, executable precedence, and cross-platform behavior are addressed; local Layers 1-3 and all required CI checks pass.
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.
Linked issue
Closes #658
Summary of changes
On Windows, dotbot reported
git: MISSING/claude: MISSINGand the workflow child window flashed and died whenever the process inherited a PATH missing the Machine or User registry scope (e.g. Git installed system-wide, Claude installed per-user) — even though both tools worked in the user's terminal. Every detection site usedGet-Command, which only searches the process PATH.Fix:
Dotbot.Core(dependency-free, imported first by every entry point):Resolve-DotbotExternalCommand— resolves a command via the process PATH, falling back to a registryMachine→UserPATH scan on Windows; reports which scope the tool was found in and can repair the session PATH.Repair-DotbotProcessPath— one-time, append-only merge of registry PATH directories missing from$env:PATH; opt-out viaDOTBOT_SKIP_PATH_REPAIR; no-op on non-Windows.Test-Preflightand theTest-GitReadyForWorktreegit gate resolve through the new resolver with session repair. Registry-scope hits produce an actionable check line naming the tool, the PATH scope, the directory, and the permanent fix. The exactMISSINGstrings are unchanged for truly-absent tools.bin/dotbot.ps1,Invoke-DotbotProcess.ps1,src/ui/server.ps1) callRepair-DotbotProcessPathonce, transparently healing all downstream spawn sites (harness adapters,ProcessStream) and UI capability probes without modifying them.dotbot doctordetects the split instead of healing it (the CLI preamble deliberately skips repair fordoctorso it observes the raw inherited PATH): a registry-only hit emits asplit PATH detectedWarn plus session and permanent fix commands.bin/dotbot.ps1swalloweddoctor.ps1's exit code —dotbot doctorexited 0 even with failing checks. The dispatcher now propagates it (same pattern asdotbot run).Testing notes
tests/Test-DependencyPathResolution.ps1encodes the issue's acceptance criteria and was failing 11/18 before the fix — it now passes 18/18. It simulates the split by spawning child pwsh processes with tool directories stripped from the process PATH while the registry PATH stays intact, and covers: preflight resolution via Machine and User scopes, the actionable scope-naming messages, doctor's split detection, and doctor exit-code propagation (with two scenarios that stay non-zero even after the PATH fix, so the propagation assertion can't trivially pass).pwsh -NoProfile -ExecutionPolicy Bypass -File tests/Test-DependencyPathResolution.ps1→ 18 passed, 0 failed.pwsh tests/Run-Tests.ps1 -Layer all→ Layers 1–3 all passed (including the static scanners and both Layer-3 mock-provider suites; the append-only repair preserves mock-first PATH ordering).Get-Commandsucceeds in the same process (session-repair proof); a directory freshly added to the real User PATH is picked up; removing the tool everywhere still yields the exactMISSINGfailure; end-to-enddotbot run smoke-testfrom a claude-stripped shell survives preflight and runs, whiledotbot doctorfrom the same shell reports the split and exits 1.Checklist