fix(doctor): canonicalize git checkout detection#85735
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-23 15:33 UTC / May 23, 2026, 11:33 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
PR Surface View PR surface stats
Summary Reproducibility: yes. Current main compares the raw git top-level string to the package root, so a symlink or junction path and its real checkout path can reproduce the false PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the focused canonical-path comparison after maintainer review confirms the protected-label workflow and current checks are acceptable. Do we have a high-confidence way to reproduce the issue? Yes. Current main compares the raw git top-level string to the package root, so a symlink or junction path and its real checkout path can reproduce the false Is this the best way to solve the issue? Yes. Canonicalizing both paths before comparing is the narrow maintainable fix, matches the existing update-runner contract, and preserves the different-root and non-repository cases. Label changes:
Label justifications:
Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against d9f73cfe3349. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Neon Branchling Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
7829791 to
c89143e
Compare
2bcbd1c to
40ea728
Compare
|
@clawsweeper re-review Current-head refresh/proof:
This should clear the prior conflict/check-run state; CI is rerunning on the new head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
40ea728 to
5d89c2b
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
1c1a0f8 to
55a7871
Compare
55a7871 to
4318405
Compare
Summary
Fixes #82215 by canonicalizing the doctor pre-update git checkout comparison.
openclaw doctornow compares thegit rev-parse --show-toplevelresult and the resolved OpenClaw package root by filesystem realpath, so junction/symlink-backed source installs are treated as git checkouts instead of package installs.This keeps the existing package-manager guidance when git reports a genuinely different root or when git explicitly says the root is not a repository.
Verification
corepack pnpm installnode_modules/.bin/oxfmt --check --threads=1 CHANGELOG.md src/commands/doctor-update.ts src/commands/doctor-update.test.tsnode_modules/.bin/oxlint src/commands/doctor-update.ts src/commands/doctor-update.test.tsgit diff --checkblacksmith-testbox, idtbx_01ksak2cz5znsggspmnjce91p3, Actions run https://github.com/openclaw/openclaw/actions/runs/26334983419:CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 corepack pnpm test src/commands/doctor-update.test.ts/mnt/c/src/claws-hapi/.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainReal behavior proof
Behavior addressed:
openclaw doctorno longer shows package-manager update guidance for a source checkout reached through a junction/symlink when that linked package root and git's top-level path resolve to the same filesystem location.Real environment tested: Blacksmith Testbox through Crabbox (
provider=blacksmith-testbox, idtbx_01ksak2cz5znsggspmnjce91p3, GitHub Actions run https://github.com/openclaw/openclaw/actions/runs/26334983419).Exact steps or command run after this patch:
CI=1 NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 OPENCLAW_TESTBOX=1 OPENCLAW_TESTBOX_REMOTE_RUN=1 corepack pnpm test src/commands/doctor-update.test.tsEvidence after fix: The regression test stubs
git -C <linked-root> rev-parse --show-toplevelto return the real checkout path and stubsfs.realpathso both the linked root and real root resolve to the same canonical path; doctor then offers the git update prompt instead of the not-git/package-manager note. A companion test keeps the not-git note when the canonical paths differ.Observed result after fix: Testbox reported
src/commands/doctor-update.test.ts (2 tests)passed.What was not tested: A full interactive native Windows junction install was not run in this PR; the covered behavior is the internal doctor decision point that receives the linked package root and git top-level path.
Additional linked-checkout proof after maintainer review:
/root/src/openclaw-82215-link->/root/src/openclaw-82215.yes n | timeout 75s script -q -e -c "stty cols 120 rows 40; env TERM=dumb NO_COLOR=1 FORCE_COLOR=0 CI=0 OPENCLAW_HOME=<temp> OPENCLAW_STATE_DIR=<temp>/state NODE_OPTIONS=--no-warnings node --preserve-symlinks --preserve-symlinks-main --import tsx ./src/entry.ts doctor" /tmp/openclaw-85735-symlink-doctor-2.log.pwdwas/root/src/openclaw-82215-link;pwd -Pwas/root/src/openclaw-82215;git -C /root/src/openclaw-82215-link rev-parse --show-toplevelreturned/root/src/openclaw-82215.Update OpenClaw from git before running doctor?and did not printThis install is not a git checkout.Noto avoid running the update flow.