Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): unreadable sessions no longer block older history #42613

MergedStiensWout(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/42613/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 92 additions and 9 deletions.

x
0 of 2 viewed, 2 left
57 additions and 0 deletionsapps/server/src/project/AgentSessionScanner.test.tsModified
View file
@@ -1766,6 +1766,63 @@
+ it.effect("imports older history behind 100 unreadable sessions", () =>
+ Effect.gen(function* () {
+ const path = yield* Path.Path;
+ const nowMs = Date.parse("2026-08-24T12:00:00.000Z");
+ yield* TestClock.setTime(nowMs);
+ const claudeHomePath = yield* makeTempDir("t3code-claude-home-");
+ const codexHomePath = yield* makeTempDir("t3code-codex-home-");
+ const workspace = yield* makeTempDir("t3code-workspace-");
+ const sessions = path.join(claudeHomePath, "pi-agent", "sessions", "--workspace--");
+ // Nesting past the JSON reader's depth limit makes a transcript unreadable.
+ const tooDeep = "[".repeat(130) + "]".repeat(130);
+ for (let index = 0; index < 100; index++) {
+ const header = encodeTranscriptRecord({
+ type: "session",
+ version: 3,
+ id: `unreadable-${index}`,
+ cwd: workspace,
+ });
+ yield* writeTranscript({
+ filePath: path.join(sessions, `unreadable-${index}.jsonl`),
+ contents: `${header}\n${tooDeep}\n`,
+ mtimeMs: nowMs - (index + 1) * 1_000,
+ });
+ }
+ yield* writeTranscript({
+ filePath: path.join(sessions, "older.jsonl"),