Skip to content

test: make workspace-load symlink tests compatible with Windows#97437

Open
aniruddhaadak80 wants to merge 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix/workspace-load-symlink-skip-win32-final
Open

test: make workspace-load symlink tests compatible with Windows#97437
aniruddhaadak80 wants to merge 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix/workspace-load-symlink-skip-win32-final

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where several workspace-load symlink boundary tests were unconditionally skipped on Windows environments, even if the environment supports creating file and directory symlinks (like with Developer Mode enabled).

Why This Change Was Made

Replaces the hardcoded process.platform !== "win32" skips with dynamic capability checks (canCreateDirectorySymlinks and canCreateFileSymlinks). If file and directory symlinks are supported by the environment, the tests execute. Otherwise, they skip gracefully while keeping coverage active on capable hosts.

User Impact

No user-visible product impact. This improves test portability and preserves regression coverage on capable Windows environments.

Evidence

  • Tests run on Windows when directory junctions are supported.
  • vitest run src/skills/loading/workspace-load.test.ts passes.
  • Code conforms to existing symlink capability patterns.

@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 28, 2026, 3:18 AM ET / 07:18 UTC.

Summary
The PR changes src/skills/loading/workspace-load.test.ts to probe directory/file symlink capability and replace Windows-only skips with capability-based skips for workspace-load symlink tests.

PR surface: Tests +47. Total +47 across 1 file.

Reproducibility: yes. from source inspection: on Windows, the new directory capability probe uses junction, but two newly guarded tests still create "dir" symlinks. I did not run a Windows host in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Replace the remaining guarded fs.symlink(..., "dir") setup calls with directorySymlinkType or change the guard to probe true directory symlink support.
  • [P1] Add redacted Windows terminal output or logs showing the workspace-load test file runs or skips correctly after the fix.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body asserts a Windows run and a Vitest command but includes no terminal output, screenshot, log, or linked artifact showing the after-fix Windows behavior; the contributor should add redacted proof and then trigger re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] As written, a Windows runner where junctions work but directory symlinks require privilege can enter two tests and fail before exercising the intended workspace-load behavior.
  • [P1] The PR body claims a Windows run but provides no terminal output, log, screenshot, or artifact, so the after-fix Windows behavior is not independently reviewable.

Maintainer options:

  1. Align the Windows symlink type before merge (recommended)
    Update both repo-root detection cases to use directorySymlinkType, or change the guard to probe true directory symlink privileges so the setup and skip condition agree.
  2. Keep these cases POSIX-only
    If maintainers do not want junction coverage here, restore a Windows skip for the affected tests and leave the coverage expansion for a later helper-level change.
  3. Pause the parallel symlink-test batch
    Because several parallel PRs apply the same pattern, maintainers can pause this batch until one corrected Windows symlink-test pattern is agreed.

Next step before merge

  • [P1] Human or contributor follow-up is needed because the code fix is narrow but the required Windows real-behavior proof must come from a real capable Windows setup.

Security
Cleared: The diff is limited to a test file and temporary symlink capability probes; I found no concrete security or supply-chain regression.

Review findings

  • [P2] Use the junction-safe link type in this guarded test — src/skills/loading/workspace-load.test.ts:1011
  • [P2] Keep the configured-roots guard aligned with its setup — src/skills/loading/workspace-load.test.ts:1043
Review details

Best possible solution:

Land a corrected test-only change that uses a consistent symlink capability/type helper for every guarded directory link, then attach redacted Windows terminal proof showing the workspace-load test file runs or skips as intended.

Do we have a high-confidence way to reproduce the issue?

Yes from source inspection: on Windows, the new directory capability probe uses junction, but two newly guarded tests still create "dir" symlinks. I did not run a Windows host in this read-only review.

Is this the best way to solve the issue?

No. The narrow maintainable fix is to align the remaining fs.symlink(..., "dir") calls with directorySymlinkType, or intentionally probe true directory-symlink privileges and keep junction-only hosts skipped.

Full review comments:

  • [P2] Use the junction-safe link type in this guarded test — src/skills/loading/workspace-load.test.ts:1011
    The new guard proves that directorySymlinkType works, which is junction on Windows, but this test still creates the repo-root escape with fs.symlink(..., "dir") later in the body. On a Windows host where junctions work but directory symlinks need elevated privilege, the guard passes and the test fails with EPERM; use directorySymlinkType here too, or make the guard probe actual "dir" symlink support.
    Confidence: 0.91
  • [P2] Keep the configured-roots guard aligned with its setup — src/skills/loading/workspace-load.test.ts:1043
    This guard has the same mismatch: it allows Windows when junction creation succeeds, but the test setup below still calls fs.symlink(..., "dir"). That means a junction-only Windows environment will run the test and fail during setup instead of skipping gracefully; use the same directory link type as the probe or keep this case skipped unless true directory symlinks are available.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9c95abd49d45.

Label changes

Label changes:

  • add P3: This is a low-risk test-portability cleanup with no user-visible product behavior change.
  • add merge-risk: 🚨 automation: The diff changes test execution behavior and can make Windows test automation run cases guarded by a junction probe while still creating true directory symlinks.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body asserts a Windows run and a Vitest command but includes no terminal output, screenshot, log, or linked artifact showing the after-fix Windows behavior; the contributor should add redacted proof and then trigger re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a low-risk test-portability cleanup with no user-visible product behavior change.
  • merge-risk: 🚨 automation: The diff changes test execution behavior and can make Windows test automation run cases guarded by a junction probe while still creating true directory symlinks.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body asserts a Windows run and a Vitest command but includes no terminal output, screenshot, log, or linked artifact showing the after-fix Windows behavior; the contributor should add redacted proof and then trigger re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Tests +47. Total +47 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 61 14 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 61 14 +47

What I checked:

  • Repository policy read: Root AGENTS.md was read fully and applied; it requires whole-module PR review, sibling pattern checks, and dependency-backed behavior checks for concrete verdicts. (AGENTS.md:1, 9c95abd49d45)
  • PR head guard/type mismatch: The PR head defines directorySymlinkType as junction on Windows and uses canCreateDirectorySymlinks to guard this test, but the test body still creates a directory link with literal "dir" later in the same case. (src/skills/loading/workspace-load.test.ts:1011, 7d5f2f3933a7)
  • Second PR head guard/type mismatch: The second repo-root symlink test has the same new junction-capability guard while its setup still calls fs.symlink(..., "dir"), so the same Windows EPERM failure path remains. (src/skills/loading/workspace-load.test.ts:1043, 7d5f2f3933a7)
  • Sibling pattern evidence: A sibling test file probes directorySymlinkType before declaration-time skipIf and uses the same type for directory symlink setup, which is the pattern this PR should apply consistently. (src/infra/install-safe-path.test.ts:17, 9c95abd49d45)
  • Current main behavior: Current main unconditionally skips the affected workspace-load symlink cases on Windows, so the PR is changing test execution behavior rather than product runtime behavior. (src/skills/loading/workspace-load.test.ts:492, 9c95abd49d45)
  • Dependency contract check: Local Node's fs.symlinkSync implementation validates dir, file, and junction as distinct symlink types, supporting the conclusion that a junction probe does not prove literal "dir" symlink creation.

Likely related people:

  • ooiuuii: git blame attributes the current workspace-load symlink tests and their Windows skips to merge commit 9d800b71c060bdebcfabb9b363dd004c74e3c1bd, whose source PR was authored by this login. (role: recent area contributor; confidence: medium; commits: 9d800b71c060; files: src/skills/loading/workspace-load.test.ts)
  • vincentkoc: Live metadata for https://github.com/openclaw/openclaw/pull/95534 shows this login merged the commit that introduced the current test-file lines in the local history. (role: merger; confidence: medium; commits: 9d800b71c060; files: src/skills/loading/workspace-load.test.ts)
  • stevenepalmer: This login authored a recently merged skill symlink repair touching src/skills/loading/plugin-skills.ts and its tests, which is adjacent to the symlink behavior covered here. (role: recent adjacent contributor; confidence: low; commits: 39328ed69285; files: src/skills/loading/plugin-skills.ts, src/skills/loading/plugin-skills.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant