@@ -457,6 +457,12 @@ describe("readClaudeCliFallbackSeed", () => {
|
457 | 457 | return readClaudeCliFallbackSeed({ cliSessionId, homeDir }); |
458 | 458 | } |
459 | 459 | |
| 460 | +function readFallbackSeedFromHome( |
| 461 | +cliSessionId = SESSION_ID, |
| 462 | +): Promise<ReturnType<typeof readClaudeCliFallbackSeed>> { |
| 463 | +return withEnvAsync({ HOME: homeDir }, async () => readClaudeCliFallbackSeed({ cliSessionId })); |
| 464 | +} |
| 465 | + |
460 | 466 | async function writeJsonl(lines: ReadonlyArray<Record<string, unknown>>): Promise<void> { |
461 | 467 | const file = path.join(projectsDir, `${SESSION_ID}.jsonl`); |
462 | 468 | await fs.writeFile(file, `${lines.map((line) => JSON.stringify(line)).join("\n")}\n`, "utf-8"); |
@@ -467,7 +473,7 @@ describe("readClaudeCliFallbackSeed", () => {
|
467 | 473 | expect(seed).toBeUndefined(); |
468 | 474 | }); |
469 | 475 | |
470 | | -it("collects user/assistant turns when the session has never been compacted", async () => { |
| 476 | +it("collects user/assistant turns through the HOME-resolved session store", async () => { |
471 | 477 | await writeJsonl([ |
472 | 478 | { |
473 | 479 | type: "user", |
@@ -490,7 +496,7 @@ describe("readClaudeCliFallbackSeed", () => {
|
490 | 496 | }, |
491 | 497 | ]); |
492 | 498 | |
493 | | -const seed = readFallbackSeed(); |
| 499 | +const seed = await readFallbackSeedFromHome(); |
494 | 500 | const fallbackSeed = requireFallbackSeed(seed, "uncompacted session"); |
495 | 501 | expect(fallbackSeed.summaryText).toBeUndefined(); |
496 | 502 | expect(fallbackSeed.recentTurns).toHaveLength(3); |
|