Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(server): symlink tests are skipped where the host cannot create symlinks #18212

ClosedAdEx-Partners-DE(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/18212/headopened View on GitHub

Problem

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 link
  • reloads when the destination of a symlinked settings file changes
  • follows a settings link that is repointed to another directory
  • reloads 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 alias
  • matches a persisted project alias to a transcript realpath
  • excludes 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 the EPERM above.
  • After: same command → 53 passed, 4 skipped.
  • vp test run src/project/AgentSessionScanner.test.ts: before, 6 failed, 3 of them with this EPERM; 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 --noEmit for apps/server passes. vp lint on the file reports only two existing no-inline-schema-compile warnings 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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at e7264dc

      Macroscope'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.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. juliusmarminge added labelsmacroscope-review

    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      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.ts
      Both test files use symlinksSupported to 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 e7264

      The 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 e7264

      The change affects 1 system.

      Changed systems: apps/server

      Architecture 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 symlinksSupported to 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 | Passed 4
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Title checkPassedThe title clearly and concisely describes the main change: skipping symlink-dependent server tests on hosts that cannot create symlinks.
      Description checkPassedThe 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.
    5. Note

      Written by gpt-6.1-sol on behalf of Maria

      Thanks 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.

    6. maria-rcks closed this

Sign in to join this conversation.