class

Smith::Events::HistoryCompacted

Inherits Smith::Events::Event < Reference < Object

Emitted when the transcript was shrunk to stay inside the context window, so a user never silently wonders where their context went.

Carries raw numbers only; the renderers do the arithmetic and the wording. Which stages ran is reported here rather than as new Strategy members, so persisted sessions and anything reading the strategy string are unaffected.

Constructors

new(before_tokens : Int32, after_tokens : Int32, strategy : String, target_tokens : Int32 = 0, budget_tokens : Int32 = 0, stages : Array(String) = [] of String)
Source

Instance methods

after_tokens
Source
before_tokens
Source
budget_tokens
Source
reached_target?
Source
reclaimed_percent

How much of the window came back. The number that says at a glance whether a compaction did useful work — two bare token counts do not.

Source
stages
Source
strategy
Source
target_tokens
Source