Skip to content

test: make zalo token resolver symlink test compatible with Windows#90280

Closed
aniruddhaadak80 wants to merge 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix/zalo-token-symlink-skip-win32
Closed

test: make zalo token resolver symlink test compatible with Windows#90280
aniruddhaadak80 wants to merge 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix/zalo-token-symlink-skip-win32

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

Replaces the hardcoded Windows skip in the Zalo token resolver test suite with a dynamic canCreateFileSymlinks capability check. If file symlinking is supported by the OS environment, the test executes. Otherwise, it skips gracefully, allowing correct platform-specific testing.

Verified Windows Proof

The following test execution log shows the test run on Windows. Since file symlink creation is not permitted on this host, the symlinked token file rejection test was skipped gracefully as expected (1 skipped, 5 passed), rather than failing the whole suite:

 RUN  v4.1.7 C:/Users/ANIRUDDHA/.gemini/antigravity/scratch/openclaw

 ✓  extension-zalo  ../../extensions/zalo/src/token.test.ts (6 tests | 1 skipped) 167ms

 Test Files  1 passed (1)
      Tests  5 passed | 1 skipped (6)

Copilot AI review requested due to automatic review settings June 4, 2026 09:44
@openclaw-barnacle openclaw-barnacle Bot added channel: zalo Channel integration: zalo 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 Zalo token test suite to skip the “rejects symlinked token files” test based on actual symlink capability rather than a Windows-only platform check.

Changes:

  • Add a runtime probe to detect whether file symlinks can be created in the current environment.
  • Replace the process.platform !== "win32" gating with a capability-based skip for the symlink-related test.

Comment on lines +8 to +21
const canCreateFileSymlinks = (() => {
const probeDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-zalo-token-probe-"));
const targetFile = path.join(probeDir, "target.txt");
const linkFile = path.join(probeDir, "link.txt");
try {
fs.writeFileSync(targetFile, "target", "utf8");
fs.symlinkSync(targetFile, linkFile, "file");
return true;
} catch {
return false;
} finally {
fs.rmSync(probeDir, { recursive: true, force: true });
}
})();
});

it.runIf(process.platform !== "win32")("rejects symlinked token files", () => {
it.skipIf(!canCreateFileSymlinks)("rejects symlinked token files", () => {
@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 1:55 PM ET / 17:55 UTC.

Summary
The PR changes the Zalo token resolver symlink test from a Windows platform gate to a file-symlink capability check with graceful skipping.

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

Reproducibility: yes. Source inspection shows current main still gates the Zalo symlink-token assertion on process.platform rather than file-symlink capability, and the PR body includes Windows terminal proof for the changed test behavior.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
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] Maintainers should choose whether to land this narrow Zalo PR now or first repair the conflicting combined replacement.

Risk before merge

Maintainer options:

  1. Decide the mitigation before merge
    Land this narrow Zalo-only test portability fix after maintainer review, unless maintainers first repair test: gate symlink assertions on file symlink capability #95531 and intentionally use that combined branch instead.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed on this branch; the remaining action is maintainer choice between landing this narrow PR and repairing the broader overlapping replacement.

Security
Cleared: The diff is test-only and does not change runtime code, dependency sources, workflows, package metadata, credentials, or supply-chain surfaces.

Review details

Best possible solution:

Land this narrow Zalo-only test portability fix after maintainer review, unless maintainers first repair #95531 and intentionally use that combined branch instead.

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

Yes. Source inspection shows current main still gates the Zalo symlink-token assertion on process.platform rather than file-symlink capability, and the PR body includes Windows terminal proof for the changed test behavior.

Is this the best way to solve the issue?

Yes for the narrow Zalo-only cleanup. The combined replacement could be cleaner if repaired, but it is currently conflicting with a failed check, so this PR remains a maintainable path.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is a low-risk test portability cleanup with no runtime, configuration, dependency, credential, or package behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 Windows terminal output showing the changed Zalo test file passed with the symlink assertion skipped on a host without file-symlink permission.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes Windows terminal output showing the changed Zalo test file passed with the symlink assertion skipped on a host without file-symlink permission.
Evidence reviewed

PR surface:

Tests +15. Total +15 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 16 1 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 16 1 +15

What I checked:

  • Repository policy read: Root AGENTS.md and scoped extensions/AGENTS.md were read fully enough for this bundled-plugin test review; their deep-review and extension-boundary guidance applied. (AGENTS.md:1, b580258e94e0)
  • Current main still has the Zalo platform gate: Current main runs the Zalo symlink-token assertion only when process.platform is not win32, so capable Windows hosts still do not exercise this assertion. (extensions/zalo/src/token.test.ts:78, b580258e94e0)
  • Runtime behavior under test is unchanged: The Zalo resolver still reads token files through tryReadSecretFileSync with rejectSymlink enabled; the PR affects test reachability, not runtime token resolution. (extensions/zalo/src/token.ts:14, b580258e94e0)
  • PR head implements the narrow Zalo capability gate: The live PR diff adds a file-symlink probe and switches the Zalo symlink assertion to skip only when the host cannot create file symlinks. (extensions/zalo/src/token.test.ts:90, fb0de0914912)
  • Contributor proof is relevant: The PR body includes Windows terminal output for extensions/zalo/src/token.test.ts showing five tests passed and one symlink assertion skipped on a host without file-symlink permission. (fb0de0914912)
  • Broader replacement is not a safe close target: The broader replacement PR is open but currently reports mergeable CONFLICTING, mergeStateStatus DIRTY, and a failed checks-fast-bundled-protocol job, so it cannot safely supersede this PR today. (bc8fcfa3c9d1)

Likely related people:

  • steipete: History shows this account authored the secret-file hardening commit that added the Zalo symlink-token assertion and rejectSymlink resolver path this PR keeps reachable. (role: feature-history contributor; confidence: high; commits: 201420a7ee91; files: extensions/zalo/src/token.test.ts, extensions/zalo/src/token.ts, src/infra/secret-file.ts)
  • RomneyDa: GitHub history for extensions/zalo/src/token.test.ts shows this account restored the fail-closed symlink rejection contract and updated the Zalo symlink test expectation. (role: adjacent fail-closed test contributor; confidence: medium; commits: 90fd26b602b0; files: extensions/zalo/src/token.test.ts, src/infra/secret-file.ts)
  • Takhoffman: Recent Zalo token resolver history shows this account changed the default-account token behavior and adjacent tests in the same resolver surface. (role: adjacent Zalo token contributor; confidence: medium; commits: 5eb3341db136; files: extensions/zalo/src/token.test.ts, extensions/zalo/src/token.ts)
  • vincentkoc: This account owns the broader open replacement PR and appears in recent Zalo token history, but that replacement is currently conflicting and not a safe close target. (role: replacement PR owner and adjacent contributor; confidence: medium; commits: 76c22217174c, bc8fcfa3c9d1; files: extensions/zalo/src/token.ts, extensions/zalo/src/token.test.ts, extensions/qqbot/src/engine/utils/file-utils.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 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
@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:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 21, 2026
@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/zalo-token-symlink-skip-win32 branch from 2d52325 to 83700d2 Compare June 23, 2026 07:25
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 23, 2026
@aniruddhaadak80
aniruddhaadak80 force-pushed the fix/zalo-token-symlink-skip-win32 branch from 83700d2 to fb0de09 Compare June 28, 2026 17:42
@aniruddhaadak80

Copy link
Copy Markdown
Contributor Author

Rebased onto main. Ready for re-review.

@vincentkoc

Copy link
Copy Markdown
Member

Closing as superseded by the merged combined symlink-test fix in #95531 (merge commit c0ee7a1). That PR carries the same Zalo capability-gated test behavior and also includes the related QQBot cleanup, so keeping this separate branch open would duplicate the landed path. Thanks for the original fix direction here.

@vincentkoc vincentkoc closed this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: zalo Channel integration: zalo P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants