From e8e77bb6b3f79fdc484d80f889bbbac045b3847d Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Sun, 8 Nov 2026 20:03:15 +0000 Subject: [PATCH] test(session-history): pin that scope-only drops out-of-scope recency rows --- .../session-scanner-scope-only.test.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/ai-vault/session-scanner-scope-only.test.ts b/src/main/ai-vault/session-scanner-scope-only.test.ts index 1d3076a3c1d..20390726829 100644 --- a/src/main/ai-vault/session-scanner-scope-only.test.ts +++ b/src/main/ai-vault/session-scanner-scope-only.test.ts @@ -161,6 +161,27 @@ describe('scanAiVaultSessions scopeOnly', () => { cwd: '/elsewhere', iso: '2026-06-02T00:00:00.000Z' }) + // Codex has no cwd buckets, so it still goes through the recency pass. + const codexDir = join(isolatedScanRoots(root).codexSessionsDir, '2026', '06', '03') + await mkdir(codexDir, { recursive: true }) + const codexId = '019e9693-64fc-7370-9c18-7e625c595d0f' + await writeFile( + join(codexDir, `rollout-2026-06-03T00-00-00-${codexId}.jsonl`), + [ + { + timestamp: '2026-06-03T00:00:00.000Z', + type: 'session_meta', + payload: { id: codexId, cwd: '/elsewhere' } + }, + { + timestamp: '2026-06-03T00:00:01.000Z', + type: 'response_item', + payload: { type: 'message', role: 'user', content: [{ type: 'text', text: 'hi' }] } + } + ] + .map((record) => JSON.stringify(record)) + .join('\n') + ) const result = await scanAiVaultSessions({ ...isolatedScanRoots(root),