Skip to content

test: make install-safe-path symlink tests compatible with Windows#90275

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix/install-safe-path-symlink-skip-win32
Jun 16, 2026
Merged

test: make install-safe-path symlink tests compatible with Windows#90275
vincentkoc merged 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix/install-safe-path-symlink-skip-win32

Conversation

@aniruddhaadak80

@aniruddhaadak80 aniruddhaadak80 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Run the existing install-path symlink boundary tests on Windows when directory junctions are supported.
  • Use Windows junctions for directory links while preserving dir symlinks elsewhere.
  • Keep production install-path behavior unchanged.
  • Treat temporary-directory or cleanup failures in the capability probe as unsupported test environments instead of failing module import.

Linked context

No linked issue. This is a test portability improvement for existing install-path boundary coverage.

Real behavior proof

  • Behavior addressed: Three install-safe-path symlink boundary tests were unconditionally skipped on Windows.
  • Real environment tested: Native Windows Azure VM (Standard_D4ads_v6) through Crabbox.
  • Exact steps or command run after this patch: node scripts/run-vitest.mjs src/infra/install-safe-path.test.ts
  • Evidence after fix: Native Windows console output from Crabbox lease cbx_be4230e2069c, run run_0fb83e164185:
RUN  v4.1.8 C:/repo/openclaw

✓ infra src/infra/install-safe-path.test.ts (24 tests) 525ms

Test Files  1 passed (1)
Tests       24 passed (24)
  • Observed result after fix: The directory-junction cases executed successfully on native Windows instead of being skipped by platform.
  • What was not tested: No end-user install flow was exercised because the patch changes tests only.
  • Proof limitations or environment constraints: The tests still skip when the host cannot create directory links.
  • Before evidence: Current main uses it.runIf(process.platform !== "win32") for all three cases.

Tests and validation

  • node scripts/run-vitest.mjs src/infra/install-safe-path.test.ts
  • node scripts/run-oxlint.mjs src/infra/install-safe-path.test.ts
  • Native Windows Crabbox: 24/24 tests passed
  • Blacksmith Testbox tbx_01kv72nvfyz4fgpny8cyn48xfr: pnpm check:changed
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main

Risk checklist

  • Did user-visible behavior change? No
  • Did config, environment, or migration behavior change? No
  • Did security, auth, secrets, network, or tool execution behavior change? No
  • Highest-risk area: Windows directory-link capability detection in the test harness.
  • Mitigation: Capability-gated execution plus direct native-Windows proof.

Current review state

  • Next action: Refresh CI on the rebased head and merge when required checks pass.
  • Addressed review comments: Temporary directory creation and cleanup are contained by the probe; module-level probing remains intentional because Vitest evaluates skipIf during test declaration.

Copilot AI review requested due to automatic review settings June 4, 2026 09:36
@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 4, 2026

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the assertCanonicalPathWithinBase test suite to run symlink-related cases on Windows when directory symlinks (junctions) are supported, instead of unconditionally skipping Windows.

Changes:

  • Add a runtime probe (canCreateDirectorySymlinks) to detect whether directory symlinks/junctions can be created in the current environment.
  • Replace it.runIf(process.platform !== "win32") with it.skipIf(!canCreateDirectorySymlinks) to skip only when symlinks are unavailable.
  • Create directory links using the appropriate fs.symlink type (junction on Windows, dir elsewhere).

Comment thread src/infra/install-safe-path.test.ts
Comment thread src/infra/install-safe-path.test.ts
@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 10:59 AM ET / 14:59 UTC.

Summary
The PR changes src/infra/install-safe-path.test.ts to capability-gate directory symlink tests and use Windows junction links instead of skipping those cases on every Windows host.

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

Reproducibility: yes. Current main source still unconditionally skips the three symlink boundary tests on win32, and the PR body includes Windows terminal output showing the changed test file passing 24 tests.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • [P2] Refresh or rebase onto current main and require fresh required checks before merge.

Risk before merge

  • [P1] The live PR rollup still contains old failing checks on a stale merge commit, including unrelated plugin-contract and lint failures; maintainers should rely on fresh required checks after refresh/rebase before merging.

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow test portability patch after maintainer review and fresh required checks, keeping production install-path helpers unchanged.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair lane is needed; the branch is reviewable as-is and needs maintainer review plus fresh required checks.

Security
Cleared: The diff only changes a test file and adds no dependency, workflow, secret, package, or runtime code-execution surface.

Review details

Best possible solution:

Land the narrow test portability patch after maintainer review and fresh required checks, keeping production install-path helpers unchanged.

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

Yes. Current main source still unconditionally skips the three symlink boundary tests on win32, and the PR body includes Windows terminal output showing the changed test file passing 24 tests.

Is this the best way to solve the issue?

Yes. Capability-gating these tests and using Windows junctions is the narrow test-layer fix; production install-path helpers and callers stay unchanged.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is a low-risk test-only Windows compatibility cleanup with no runtime, config, provider, or user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix Windows terminal output showing src/infra/install-safe-path.test.ts passing 24 tests.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix Windows terminal output showing src/infra/install-safe-path.test.ts passing 24 tests.
Evidence reviewed

PR surface:

Tests +17. Total +17 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 23 6 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 23 6 +17

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the March 2026 commits that expanded and tightened install-safe-path coverage, and git shortlog shows the most history in the central install-safe-path files. (role: introduced behavior and feature-history owner; confidence: high; commits: 0f4855624177, 1ae216341341, 104d32bb64cd; files: src/infra/install-safe-path.test.ts, src/infra/install-safe-path.ts, src/infra/install-package-dir.ts)
  • vincentkoc: Vincent Koc appears in recent history for src/infra/install-safe-path.test.ts and src/infra/install-safe-path.ts, including the latest release commit that carried these files. (role: recent area contributor; confidence: medium; commits: 8c802aa68351, c6611639ab9c; files: src/infra/install-safe-path.test.ts, src/infra/install-safe-path.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 proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 4, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 4, 2026
@aniruddhaadak80

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/infra/install-safe-path.test.ts
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jun 15, 2026
@vincentkoc vincentkoc self-assigned this Jun 16, 2026
@vincentkoc
vincentkoc force-pushed the fix/install-safe-path-symlink-skip-win32 branch from 04f3e2b to 53f987d Compare June 16, 2026 02:06
@openclaw-barnacle openclaw-barnacle Bot added triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. proof: supplied External PR includes structured after-fix real behavior proof. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 16, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Land-ready verification for head 53f987d3ae8cbdd9ca3c155387998997d6606967:

The broad CI matrix has one unrelated failure in src/commands/migrate/apply.test.ts: its mock omits the existing resolveGatewayPort export. This PR changes only src/infra/install-safe-path.test.ts; the identical checks-node-agentic-commands-status-tools shard passed on the exact base SHA a4e7d9a0dbbf04b4932169bece25dc29023640d6: https://github.com/openclaw/openclaw/actions/runs/27588149842/job/81563012979

@vincentkoc
vincentkoc merged commit 11a0ad1 into openclaw:main Jun 16, 2026
311 of 318 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants