test(server): symlink tests are skipped where the host cannot create symlinks #18212
main fromrefs/pull/18212/head·opened View on GitHubProblem#
Seven tests in apps/server fail on a Windows host without Developer Mode. Four in src/serverSettings.test.ts:
saves through a symlinked settings file without replacing the linkreloads when the destination of a symlinked settings file changesfollows a settings link that is repointed to another directoryreloads when a dangling settings link gets its destination
and three in src/project/AgentSessionScanner.test.ts (added in the second commit, same cause):
returns the imported project ID through a realpath aliasmatches a persisted project alias to a transcript realpathexcludes sandboxes reached through a symlink into the worktrees dir
Each plants a symlink during setup, and Windows refuses that for an unprivileged process:
EPERM: operation not permitted, symlink '…\t3-settings-dotfiles-…\settings.json' -> '…\settings.json'
So they fail before reaching any assertion. The repo already has a probe for exactly this, symlinksSupported in @t3tools/shared/testing/symlinks, whose comment says such tests should skipIf(!symlinksSupported) rather than fail at setup. Fifteen other server test files use it. serverSettings.test.ts was missed, and AgentSessionScanner.test.ts already guards one of its symlink tests with it but not these three.
Fix#
The seven tests use it.effect.skipIf(!symlinksSupported). Test-only, two files, no product code touched. The diff looks larger than it is because the formatter re-wraps and re-indents test bodies once the call no longer fits on one line; ignoring whitespace it is 17 changed lines in the first file and 12 in the second.
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. Same kind of change as #17080.
Evidence#
Windows 11 without Developer Mode, on main at ed0f7b908, in apps/server:
- Before:
vp test run src/serverSettings.test.ts→ 4 failed, 53 passed, each failure theEPERMabove. - After: same command → 53 passed, 4 skipped.
vp test run src/project/AgentSessionScanner.test.ts: before, 6 failed, 3 of them with thisEPERM; after, those 3 are skipped. The other 3 (keeps case variants distinct when the filesystem identities differ,ignores relative working directories from malformed transcripts,checks file identity and provider before skipping completed history) still fail on Windows for other reasons and are not touched here.tsc --noEmitforapps/serverpasses.vp linton the file reports only two existingno-inline-schema-compilewarnings at lines this change does not touch.
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
e7264dcMacroscope's review found this PR approvable — The PR is confined to ignored test paths and only adjusts symlink-dependent tests for hosts that cannot create symlinks. It has no production runtime, default, schema, infrastructure, security, billing, or static-analysis impact.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
juliusmarminge added labelsmacroscope-review
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:
2619cfc3-6dd7-419b-9f38-027354116203
-
📥 Commits
-
-
Reviewing files that changed from the base of the PR and between c8bd9a11f986bef4e52512035d3d3c40d78ed7da and e7264dca8028c103694b6afa8b1221ded65567b2.
-
📒 Files selected for processing (1)
-
-
apps/server/src/project/AgentSessionScanner.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
-
Walkthrough#
When symlinks are unsupported, the settings and project scanner test suites now skip tests that depend on symlinks. Test scenarios and assertions remain unchanged.
Changes#
Symlink-dependent tests
Layer / File(s) Summary Gate symlink-dependent tests
apps/server/src/serverSettings.test.ts,apps/server/src/project/AgentSessionScanner.test.tsBoth test files use symlinksSupportedto skip symlink-dependent cases. The settings tests cover saving and reloading through links. The scanner tests cover realpath-alias matching and sandbox exclusion.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Other
Suggested reviewers:
juliusmarminge
-
Merge Risk: ⚪ Minimal · up to
e7264The change skips only symlink-dependent tests when symlink creation is unavailable, while retaining their checks otherwise. No identified issue warrants delaying merge.
Architecture Summary#
Architecture risk: 🔵 Low · up to
e7264The change affects 1 system.
Changed systems:
apps/serverArchitecture concerns No architecture-level concerns identified.
Review details
-
-
Systems and components
- observed — apps/server (service) was modified; 2 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in apps/server/src/serverSettings.test.ts: The test file imports
symlinksSupportedto conditionally run symlink-dependent tests. - observed — Modified behavior in apps/server/src/serverSettings.test.ts: The test that saves settings through a symlink is now skipped when symlinks are unsupported; its existing link-preservation and persisted-value assertions remain.
- observed — Modified behavior in apps/server/src/serverSettings.test.ts: The test for reloading after a symlink destination changes is now skipped when symlinks are unsupported; it still checks that an atomic edit is observed within two seconds.
- observed — Modified behavior in apps/server/src/serverSettings.test.ts: The test for following a settings link repointed to another directory is now skipped when symlinks are unsupported; it still checks reloads after both repointing and editing the new destination.
-
Pre-merge checks |
4-
✅ Passed checks (4 passed)
-
Check name Status Explanation 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. Title check The title clearly and concisely describes the main change: skipping symlink-dependent server tests on hosts that cannot create symlinks. Description check The description covers the problem, affected tests, fix, scope rationale, verification results, limitations, and tool attribution. It uses "Fix" and "Evidence" instead of the template headings "Change…
-
✨ 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
AdEx-Partners-DE(GitHub profile, opens in a new tab) changed the title
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 test failures. The diff only adds capability-based skips to seven tests in two files; it does not repair product behavior. Right now we are only taking focused bug fixes from outside contributors, using the limited review capacity described in Read this first. Please preserve the Windows reproduction in an issue and request reconsideration there when we reopen test-maintenance work.
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed