BudgetPressureRecord
Interface: BudgetPressureRecord
Defined in: src/recorders/core/types.ts:110
Budget-pressure warning — emitted before evictions fire.
cap and projected are counted in unit. They were added in 8.14.0
beside capTokens / projectedTokens, which asserted a unit this channel
does not use: on THIS channel the numbers are CHARS (composeSlot measures
String.length), while a window strategy fills the same event with tokens.
9.0.0 removed the two misnamed fields, and cap / projected are required
in their place — a record that carried neither pair would be a record with
no numbers on it.
unit stays OPTIONAL, unlike on the event payload, because this
record is written by slot builders — including any a consumer wrote. A
missing unit reads as 'chars', which is not a guess: every write to
COMPOSITION_KEYS.BUDGET_PRESSURE comes off a slot composition, and a slot
composition is counted in characters by construction.
planAction: 'none' means no mitigation was performed — nothing was
evicted or truncated and the full content still went to the LLM. It is
the honest reading of a slot that composed over its budgetCap.
Properties
cap
readonlycap:number
Defined in: src/recorders/core/types.ts:118
The budget, in unit.
overflowBy
readonlyoverflowBy:number
Defined in: src/recorders/core/types.ts:112
planAction
readonlyplanAction:"abort"|"evict"|"summarize"|"none"
Defined in: src/recorders/core/types.ts:113
projected
readonlyprojected:number
Defined in: src/recorders/core/types.ts:120
What was measured against it, in unit.
slot
readonlyslot:ContextSlot
Defined in: src/recorders/core/types.ts:111
unit?
readonlyoptionalunit?:"chars"|"tokens"
Defined in: src/recorders/core/types.ts:116
What the numbers count. Absent on a record written by a third-party slot
builder — the slot channel is 'chars'.
