Skip to main content

Module history_files

Module history_files 

Source
Expand description

Chat History Files for Dynamic Context Discovery

Implements Cursor-style chat history persistence during summarization. When context window fills up and summarization occurs, the full conversation is written to .vtcode/history/ so agents can recover details via unified_search.

§Design Philosophy

Instead of losing conversation details during lossy summarization:

  1. Write full conversation to .vtcode/history/session_{id}_{turn}.jsonl
  2. Include file reference in summary message
  3. Agent can search history with unified_search when details are needed

Structs§

HistoryConfig
Configuration for history file persistence
HistoryFileManager
Manager for conversation history files
HistoryMessage
A single message in the history file
HistoryMetadata
Metadata about the history file
HistoryWriteResult
Result of writing a history file

Functions§

messages_to_history_messages
Convert provider-agnostic messages into persisted history messages.