test(session-history): pin that scope-only drops out-of-scope recency rows

This commit is contained in:
Kelvin Amoaba
2026-11-08 21:17:47 +00:00
parent 0aa6ecaeb2
commit e8e77bb6b3
@@ -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),