refactor(agent): share the SQLite session cache (#526)

This commit is contained in:
Yiling-J
2026-11-11 17:05:34 +08:00
committed by GitHub
parent 35a0e82284
commit 00fa5fed75
8 changed files with 509 additions and 98 deletions
@@ -202,7 +202,7 @@ describe('SQL migration to Pi Durable', () => {
(await prisma.agentSession.findUniqueOrThrow({ where: { id: child.id } })).accountedUsage,
).toMatchObject({ totalTokens: 17, cost: 0.2 })
// Read the native ledger without hydrating image references.
const cache = await openSessionCache(child.id, 'read')
const cache = await openSessionCache(child.id)
const harness = await Harness.open(
cache.storage,
{ models: createModels(), registry: createRegistry() },