FoldedSpan
Interface: FoldedSpan
Defined in: src/core/agent/window/types.ts:232
One fold, as it survives the process: the summary's fingerprint, what it
stands for, and — under retain: 'conversation' — the messages themselves.
These accumulate on the conversation checkpoint across every turn and every restart, so a standing agent that folded week one in April can still produce week one in July.
Joining a span to its summary
By CONTENT FINGERPRINT, never by index: a later fold can swallow an earlier summary, and every index in the window moves when it does. foldedSpanFor does the join for you.
Properties
foldedAtMs
readonlyfoldedAtMs:number
Defined in: src/core/agent/window/types.ts:252
Wall clock of the fold.
iteration
readonlyiteration:number
Defined in: src/core/agent/window/types.ts:250
ReAct iteration the fold happened at, in that run.
messageCount
readonlymessageCount:number
Defined in: src/core/agent/window/types.ts:256
How many messages the summary stands for. Always recorded, both policies.
messages?
readonlyoptionalmessages?: readonlyLLMMessage[]
Defined in: src/core/agent/window/types.ts:268
The folded messages, verbatim and in order. Present exactly when
retained is 'conversation'.
Absent under 'discard' — and absent is the honest shape there, rather
than an empty array that reads like "there were none".
model
readonlymodel:string
Defined in: src/core/agent/window/types.ts:254
The model that wrote the summary — a claim's author is part of the claim.
removedStageIds
readonlyremovedStageIds: readonlystring[]
Defined in: src/core/agent/window/types.ts:258
runtimeStageIds of the stages that appended those messages.
retained
readonlyretained:CompactionRetention
Defined in: src/core/agent/window/types.ts:260
Which policy this fold ran under.
runId
readonlyrunId:string
Defined in: src/core/agent/window/types.ts:248
The run whose commit log held these messages. Diagnostic, and the honest answer to "where else could I have found this?" — that log is gone with the process, which is why the messages are here.
summaryFingerprint
readonlysummaryFingerprint:string
Defined in: src/core/agent/window/types.ts:242
Fingerprint of the summary message this span was folded into — the join
key back to the message sitting in history.
It is a hash of the message's full content (authored frame included), so it costs no extra bytes on the wire and cannot be forged by a summary that merely copies the frame's opening words: different content, different fingerprint, no match.
