The best way to control Claude Code, Codex and more from any computer or phone
fix(contracts): preserve exact transcript file identities (#21463)
Julius Marminge committed
Oct 19, 2026 at 16:25 UTC
a64e045cf165918f2c006dc218395300c6570ae8
2 files changed
+9
-5
apps/server/src/project/AgentSessionScanner.ts
+6
-4
@@ -574,10 +574,12 @@ function transcriptIdentity(filePath: string, stats: FileSystem.File.Info) {
574
};
575
}
576
577
-function sameTranscriptIdentity(
578
- left: ReturnType<typeof transcriptIdentity>,
579
- right: ReturnType<typeof transcriptIdentity>,
580
-): boolean {
577
+type TranscriptIdentity = Pick<
578
+ AgentSessionImportSource,
579
+ "filePath" | "size" | "mtimeMs" | "device" | "inode" | "birthtimeMs"
580
+>;
581
+
582
+function sameTranscriptIdentity(left: TranscriptIdentity, right: TranscriptIdentity): boolean {
583
return (
584
left.filePath === right.filePath &&
585
left.size === right.size &&
packages/contracts/src/agentSessions.ts
+3
-1
@@ -13,7 +13,9 @@ export const AgentSessionImportSource = Schema.Struct({
13
size: NonNegativeInt,
14
mtimeMs: Schema.NullOr(Schema.Number),
15
device: Schema.Number,
16
- inode: Schema.NullOr(Schema.Number),
16
+ // A decimal string keeps file IDs above 2^53 (common on NTFS) exact. Older
17
+ // records stored a number.
18
+ inode: Schema.NullOr(Schema.Union([Schema.String, Schema.Number])),
19
birthtimeMs: Schema.NullOr(Schema.Number),
20
});
21
export type AgentSessionImportSource = typeof AgentSessionImportSource.Type;