Expand description
Session management and persistence for CodeI.
Structs§
- Context
Builder - Builds the message list sent to the LLM from a session.
- Session
- Session
Store - Persistent session storage (SQLite or JSONL files, selected by config).
- Stored
Message - Token
Budget - Token budget for context window management.
- Tool
Call Record
Enums§
Functions§
- cap_
output_ tokens - Cap configured max output tokens so estimated input + output fits in the context window.
- compact_
messages - Truncate older messages when over budget. Keeps system prompt and recent turns. Used as a last-resort guard when building the LLM request.
- estimate_
tokens - Rough token estimate (chars / 4).
- estimate_
tool_ defs_ tokens - Rough token estimate for tool definitions attached to a chat request.
- format_
transcript - Format stored messages into a transcript for LLM summarization.
- should_
compact_ session - Whether the session should be compacted based on estimated token usage.