Smith::Context::Breakdown
Inherits Reference < Object
Where the context window actually goes. Built by the caller, which is the only thing that knows what went into the system prompt.
This is also how the agent computes the reserved overhead it hands back
to compact: one class doing the arithmetic for both the breakdown the
user reads and the decision compaction makes, so the two cannot disagree.
Constructors
new(budget : Budget)
SourceInstance methods
add(label : String, text : String) : Nil
Empty parts are kept: "Skills 0" answers "are skills eating my context?", a missing line leaves the question open.
add(label : String, messages : Array(LLM::Message)) : Nil
Sourceadd_history(label : String, messages : Array(LLM::Message)) : Nil
The transcript, which is the one part compaction can shorten. Everything else is overhead it has to work around.
budget
Sourcecharged(tokens : Int32) : Int32
A raw estimate as the provider will charge it. Identical to the input until the session has learned how far the byte heuristic is off.
charged_total
Sourceentries
Sourcemax_tokens
Sourcepercent(tokens : Int32) : Int32
Sourcetotal
Source