Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a symlinked T3 home no longer lists managed worktrees as importable projects #35266

Closedfelixleopold(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/35266/headopened View on GitHub

Showing 2 changed files with 44 additions and 5 deletions.

x
0 of 2 viewed, 2 left
27 additions and 0 deletionsapps/server/src/project/AgentSessionScanner.test.tsModified
View file
@@ -1027,6 +1027,33 @@
+ it.effect("excludes sandboxes when the configured base dir is itself a symlink", () =>
+ Effect.gen(function* () {
+ const path = yield* Path.Path;
+ const claudeHomePath = yield* makeTempDir("t3code-claude-home-");
+ const codexHomePath = yield* makeTempDir("t3code-codex-home-");
+ const realBaseDir = yield* makeTempDir("t3code-scanner-base-");
+ const linkParent = yield* makeTempDir("t3code-scanner-links-");
+ const fileSystem = yield* FileSystem.FileSystem;
+​
+ // The server is configured through a symlinked home, while the agent
+ // recorded the real path of the managed sandbox.
+ const configBaseDir = path.join(linkParent, "t3-home");
+ yield* fileSystem.symlink(realBaseDir, configBaseDir);
+ const worktreeCwd = path.join(realBaseDir, "worktrees", "t3code", "wt-4");
+ yield* fileSystem.makeDirectory(worktreeCwd, { recursive: true });
+ yield* writeTranscript({
+ filePath: path.join(claudeHomePath, "projects", "-slug", "a.jsonl"),
+ contents: claudeSessionLine(worktreeCwd),
+ mtimeMs: Date.parse("2026-01-01T00:00:00.000Z"),
+ });
+​
+ const result = yield* runScan({ claudeHomePath, codexHomePath, configBaseDir });
+​
+ expect(result.candidates).toEqual([]);
+ }),
+ );