Files
openclaw/src/commands
Sasan dc097be00d fix(doctor): follow symlinked launcher when locating sandbox setup scripts (#90942)
* fix(doctor): follow symlinked launcher when locating sandbox setup scripts

* refactor(doctor): reuse shared package-root resolver for sandbox scripts

resolveSandboxScript hand-rolled its own cwd/argv1/realpath candidate
scan, duplicating openclaw-root discovery. Reuse resolveOpenClawPackageRootSync,
which already follows the symlinked launcher via realpath and handles
node_modules/.bin and version-manager links, then look for scripts/ under
the resolved package root. Resolves the duplicate-discovery review finding.

* fix(doctor): keep searching cwd for sandbox scripts when first package root lacks them

resolveSandboxScript stopped at the first openclaw package root the shared
resolver returned. argv1 candidates resolve before cwd, so an installed/published
root (package.json present, scripts/ dropped by the npm files allowlist) shadowed
a valid source-checkout cwd and made doctor --fix return null.

- add resolveOpenClawPackageRootsSync: all distinct roots in candidate order
- resolveSandboxScript returns the first root that actually contains the script
- resolveOpenClawPackageRootSync now delegates to the plural (behavior unchanged)
- test: source-checkout cwd shadowed by an installed argv1 root without scripts/
2026-07-11 11:36:02 +08:00
..
2026-06-04 13:00:10 -04:00