Skip to content

Promote Develop: Warn When the Windows Host Path Nears the Length Explorer Drops - #3864

Merged
ptr727 merged 1 commit into
mainfrom
develop
Nov 4, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes #3863 to main.

Closes #3475.

The maintainer scoped #3475 to that length check, so its other proposals moved to #3862. This warning has not been seen firing against a real Path over 3700, since the maintainer chose no reproduction that pushes one over the limit.

🤖 Generated with Claude Code

## Summary

Part of #3475.

Past about 4095 expanded characters, Explorer silently drops the user
half of `Path` from everything it launches. A host reaches that one
install at a time, and nothing reports it.

`install-tools.ps1` and `upgrade-host.ps1` now warn when the machine and
user `Path` together expand past 3700 characters. `install-tools.ps1`
checks in its report and after an apply, filing the warning as a note so
it reaches `-Json` too. `upgrade-host.ps1` checks in `-Status` and after
an upgrade. Neither edits `Path`.

## Scope

The maintainer chose the simplest form: the length check alone, with no
reproduction that pushes a `Path` over the limit and no CI job for one.
#3475's other proposals moved to #3862: asking Explorer directly whether
it dropped the user `Path`, and naming duplicate, missing, and shadowed
entries.

So 4095 is as #3475 reports it rather than as measured here, and the
README says so. No run has seen the warning fire against a real `Path`
over 3700.

The scripts in `host-setup/windows` share no file by rule, so each
carries the two functions, and a test holds the copies equal.

## Verification

- On a native Windows 11 host, `upgrade-host.ps1 -Status` and
`install-tools.ps1 -Report -Json` ran for real, with a `Path` under the
margin, and neither warned.
- The tests drive each call site at 3700 and 3701. Their stubbed
installs are what grow the stubbed length, so a check moved above the
installs fails. Moving each check above its installs on scratch copies
failed both ordering tests on the missing warning.
- On Windows, a test compares the length read against an independent
read of the registry values.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 4, 2026 16:31
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Approval should wait for native Windows verification because the key PowerShell registry expansion and Explorer-compatible Path behavior cannot be independently executed in this review environment.

No open issues 🎉

What changed in this PR

This pull request promotes a Windows host Path length warning to main, helping detect when Explorer may silently drop user-level Path entries.

Changes:

  • Adds read-only expanded machine and user Path length checks to both host scripts.
  • Reports warnings during installation, upgrades, reports, and status checks.
  • Documents the warning threshold, failure mode, and recovery steps.
  • Adds PowerShell-driven tests for thresholds, ordering, parity, and registry-derived lengths.
File Summary
tests/​test_install_tools.py Adds coverage for warning thresholds, call ordering, script parity, output, and registry-based length calculations.
host-setup/​windows/​upgrade-host.ps1 Warns during status checks and after host upgrades.
host-setup/​windows/​README.md Documents the warning, failure mode, and recovery guidance. A minor grammar correction was noted for one sentence.
host-setup/​windows/​install-tools.ps1 Adds path-length warnings to reports and post-install output.

This pull request is ready to be approved.

Review effort: Lite

@ptr727

ptr727 commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Answering the one headline on this round, block count (1).

"Approval should wait for native Windows verification because the key PowerShell registry expansion and Explorer-compatible Path behavior cannot be independently executed in this review environment."

No change needed. The headline names two things, and neither is a defect in the change.

  • Registry expansion. This ran natively. test_the_length_is_the_expanded_registry_values_joined compares the length the scripts read against an independent read of the registry values. It passed on a native Windows 11 host, and in the required Windows unit test job on the feature head, run 41863336209. That job also runs on this head as a required check. Both scripts also ran for real on that native host, with a Path under the margin, and neither warned.
  • Explorer's behavior. The check reads the length alone and never asks Explorer anything, so no Explorer behavior of its own needs verifying. The maintainer chose that form and declined a reproduction that pushes a Path over the limit. The README states that the limit is as reported rather than as tested here. Asking Explorer directly is tracked in Remove Dead and Duplicate Windows Path Entries From upgrade-host.ps1 #3862.

@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.31%. Comparing base (60dd068) to head (87c05af).
⚠️ Report is 465 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3864   +/-   ##
=======================================
  Coverage   83.31%   83.31%           
=======================================
  Files          29       29           
  Lines        9956     9956           
=======================================
  Hits         8295     8295           
  Misses       1661     1661           
Flag Coverage Δ
python-3.13 83.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit aab8dc2 into main Nov 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn When the Windows Host Path Grows Past the Length Explorer Silently Drops

2 participants