Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): session import skips T3 Code's own folders behind a symlinked home #23728

Closedsiddham-jain(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/23728/headopened View on GitHub

Showing 2 changed files with 45 additions and 5 deletions.

x
0 of 2 viewed, 2 left
30 additions and 0 deletionsapps/server/src/project/AgentSessionScanner.test.tsModified
View file
@@ -1052,6 +1052,36 @@
+ it.effect.skipIf(!symlinksSupported)(
+ "excludes T3 Code's own folders when its home is reached through a symlink",
+ () =>
+ Effect.gen(function* () {
+ const path = yield* Path.Path;
+ const fileSystem = yield* FileSystem.FileSystem;
+ const claudeHomePath = yield* makeTempDir("t3code-claude-home-");
+ const codexHomePath = yield* makeTempDir("t3code-codex-home-");
+ const realBaseDir = yield* fileSystem.realPath(
+ yield* makeTempDir("t3code-scanner-base-"),
+ );
+ const linkParent = yield* makeTempDir("t3code-scanner-links-");
+ const configBaseDir = path.join(linkParent, "t3-home");
+ yield* fileSystem.symlink(realBaseDir, configBaseDir);
+​
+ // Providers record the resolved cwd, so a projectless chat shows up under the real home.
+ const scratchCwd = path.join(realBaseDir, "scratch", "2026-01-01-quiet-fox");
+ yield* fileSystem.makeDirectory(scratchCwd, { recursive: true });
+ yield* writeTranscript({
+ filePath: path.join(claudeHomePath, "projects", "-slug", "a.jsonl"),
+ contents: claudeSessionLine(scratchCwd),
+ mtimeMs: Date.parse("2026-01-01T00:00:00.000Z"),
+ });
+​
+ const result = yield* runScan({ claudeHomePath, codexHomePath, configBaseDir });
+​