test(providers): OpenCode and ACP symlink tests are skipped where the host cannot create symlinks #18247
main fromrefs/pull/18247/head·opened View on GitHubProblem#
Three tests in two provider packages fail on a Windows host without Developer Mode:
packages/provider-opencode/src/server/usage.test.ts›never follows symlinks in the legacy OpenCode storepackages/provider-acp/src/server/clientPolicy.test.ts›denies mutations through workspace symlinks that escape the writable rootspackages/provider-acp/src/server/clientPolicy.test.ts›allows existing and new files beneath canonical writable roots
Each plants a symlink during setup, and Windows refuses that for an unprivileged process:
EPERM: operation not permitted, symlink '…\t3-acp-permission-outside-…\existing.ts' -> '…'
They fail before reaching an assertion. The repo has a probe for this, symlinksSupported in @t3tools/shared/testing/symlinks, whose comment says such tests should skipIf(!symlinksSupported) rather than fail at setup. provider-core and provider-cursor already use it; these two packages were missed.
This is the same cause as #18212, which covers apps/server/src/serverSettings.test.ts. I kept the provider packages separate so each PR stays small; say so if you would rather have them as one.
Fix#
The three tests use it.effect.skipIf(!symlinksSupported). Test-only, two files, no product code touched, no new dependency (both packages already depend on @t3tools/shared). The diff of clientPolicy.test.ts looks large because the formatter re-wraps and re-indents the two test bodies once the call no longer fits on one line; ignoring whitespace the whole change is 12 lines.
This qualifies as a small fix for an obvious defect: the tests cannot pass on such a host as written, and the guard is the one the repo documents for this case.
Evidence#
Windows 11 without Developer Mode, on main at ed0f7b908:
packages/provider-opencode,vp test run src/server/usage.test.ts: before, 1 failed with theEPERMabove; after, 4 passed and 1 skipped.packages/provider-acp,vp test run src/server/clientPolicy.test.ts: before, 2 failed withEPERM; after, 11 passed and 2 skipped.tsc --noEmitpasses in both packages;vp linton both files reports nothing.
Not fixed here, different causes: provider-opencode status.test.ts (reads Go limits with the instance's XDG credentials…) and three tests in provider-acp clientTerminals.test.ts also fail on this host. I have not investigated them yet.
Not checked: macOS, Linux, or Windows with Developer Mode. The probe returns true there, so the tests run unchanged; CI covers that.
Model and harness: Claude Opus 5.5 in Claude Code, running through T3 Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
3038bafMacroscope's review found this PR approvable — This is a test-only change in ignored paths that conditionally skips symlink tests on hosts unable to create symlinks; production behavior and product defaults are unaffected. The scope is localized and does not introduce static-analysis suppressions or sensitive-code changes.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9c87356b-8e23-422c-b58f-4e85a013aaea
📥 Commits
-
Reviewing files that changed from the base of the PR and between ed0f7b908b2e7b3a22e6fd82a73794c2fe6ee06e and 3038baf20f38b9e1bb1a0ee3e4d5b4386e3227b6.
📒 Files selected for processing (2)
-
packages/provider-acp/src/server/clientPolicy.test.tspackages/provider-opencode/src/server/usage.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
Walkthrough#
The ACP and OpenCode test suites now skip their symlink-related tests when the environment does not support symlinks. The existing assertions run when symlinks are supported.
Changes#
Symlink test guards
Layer / File(s) Summary Conditional symlink test execution
packages/provider-acp/src/server/clientPolicy.test.ts,packages/provider-opencode/src/server/usage.test.tsBoth test suites use symlinksSupportedto skip symlink tests when symlinks are unsupported. The ACP tests retain checks for denied escaping-path mutations and allowed edits beneath a canonical writable root.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
3038bThis change only skips symlink tests on hosts that cannot create symlinks. It does not affect production behavior and carries no meaningful merge risk.
Architecture Summary#
Architecture risk: 🔵 Low · up to
3038bThe change affects 2 systems.
Changed systems:
packages/provider-acp,packages/provider-opencodeArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — packages/provider-acp (library) was modified; 1 changed file maps to changed impact.
- observed — packages/provider-opencode (library) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in packages/provider-acp/src/server/clientPolicy.test.ts: The test file imports
symlinksSupportedfor conditional execution of symlink tests. - observed — Modified behavior in packages/provider-acp/src/server/clientPolicy.test.ts: The escaping-symlink mutation test now skips when symlinks are unsupported; otherwise, it checks that edits through an escaping file symlink, an escaping directory symlink to a missing leaf, and a path traversing that symlink before
..are denied. - observed — Modified behavior in packages/provider-acp/src/server/clientPolicy.test.ts: The canonical-root test now skips when symlinks are unsupported; otherwise, it checks that edits to existing files and new descendants are allowed when the workspace path is a symlink to the writable root.
- observed — Modified behavior in packages/provider-opencode/src/server/usage.test.ts: Added the
symlinksSupportedtest utility import.
Pre-merge checks |
4-
✅ Passed checks (4 passed)
-
Check name Status Explanation Title check The title clearly and concisely describes the main change: skipping symlink-dependent OpenCode and ACP tests on hosts that cannot create symlinks. Description check The description explains the problem, fix, scope, verification results, known limitations, and agent details. It uses alternative headings such as “Fix” and “Evidence,” but it provides the required in… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.-
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Note
Written by
gpt-6.1-solon behalf of MariaThanks for documenting the Windows symlink failures and submitting the test guards. This changes only test setup, and right now we are only taking focused bug fixes from outside contributors under the review-capacity discretion in Read this first. Please preserve the Windows reproduction in an issue so the problem is not lost, and request maintainer agreement to take on this maintenance change before seeking reconsideration.
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed