Skip to content

DiskBackend

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/agent-core/src/context/checkpoint-backend.ts

Implements: CheckpointBackend

Methods

MethodSignatureReturns
savesave(snap: Snapshot)void
loadload(relPath: string)Snapshot[]
loadLatestloadLatest(relPath: string)`Snapshot
deleteFiledeleteFile(relPath: string)void
deleteFromdeleteFrom(relPath: string, fromIndex: number)void
getTrackedFilesgetTrackedFiles()string[]
getTotalCountgetTotalCount()number
getSnapshotCountgetSnapshotCount(relPath: string)number
clearclear()void
evictOldestevictOldest()boolean
flushflush()void

Properties

PropertyType
sessionIdstring
sessionDirstring

Where it refuses work

  • DiskBackend stops the work with an early return when !snaps || snaps.length === 0, in 2 places.
  • DiskBackend stops the work with an early return when !snaps, in 2 places.
  • DiskBackend stops the work with an early return when fromIndex < 0 || fromIndex >= snaps.length.

When something fails

  • DiskBackend handles failure in 13 places: it discards it silently in 10, turns it into a return value in 2, and logs it and continues in 1.

Was this page helpful?

Download as PDF