Structs§
- Checkpoint
State - Boundary recorded by the
checkpointtool for a laterrewind. - Compact
Outcome - Outcome of
Session::compactfor autocompact circuit breakers. - Session
- A conversation session
- Session
Cost - Running USD estimate. Steps whose model has no known price are counted, not guessed.
Constants§
- COMPACT_
CONTINUATION_ PREAMBLE - Preamble prepended to the post-compact summary carrier (full-replace).
- SPILL_
HEAD_ CHARS - What stays in the transcript when an old tool body is spilled to disk: this many leading chars, then a pointer line. Under the shake cap, so neither prune nor shake cuts the pointer away.
- SPILL_
MARK - Marks a spilled body; a body that carries it is not spilled again.
- TOOL_
RESULT_ MAX_ CHARS - Soft cap on tool result bodies kept in the transcript (Unicode scalars).
- TOOL_
RESULT_ PRUNE_ CHARS - Cap for older tool results during compact (prune to ~2k chars).
Recent tool dumps stay at
TOOL_RESULT_MAX_CHARSso the model can still use the last step’s output; older steps shrink hard for TTFT. - TOOL_
RESULT_ SHAKE_ CHARS - Harder shake when the session is still over ~¾ of the compact threshold.
Functions§
- compact_
summary_ display_ text - Human-facing compact card: drop the model preamble, keep the summary body.
- default_
system_ prompt - Default system prompt for the main agent
- format_
compact_ summary - Clean a compaction-model reply into a plain summary body.
- format_
compact_ summary_ content - Continuation carrier that replaces compacted history (full-replace).
- is_
compact_ summary_ text - True when a user message is a compact stub, not a real user turn.