mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 02:01:29 +00:00
Remove event logging from session files - only save messages and state changes
Session reconstruction only needs: - type: 'session' - session metadata - type: 'message' - conversation history - type: 'thinking_level_change' - thinking level changes - type: 'model_change' - model changes Events like agent_start/end, tool_execution_start/end are not needed for session reconstruction and only added bloat. This reduces session file size significantly and speeds up writes.
This commit is contained in:
parent
9e3e319f1a
commit
5e988b444b
2 changed files with 2 additions and 23 deletions
|
|
@ -449,17 +449,12 @@ export async function main(args: string[]) {
|
|||
}
|
||||
}
|
||||
|
||||
// Subscribe to agent events to save messages and log events
|
||||
// Subscribe to agent events to save messages
|
||||
agent.subscribe((event) => {
|
||||
// Save messages on completion
|
||||
if (event.type === "message_end") {
|
||||
sessionManager.saveMessage(event.message);
|
||||
}
|
||||
|
||||
// Log all events except message_update (too verbose)
|
||||
if (event.type !== "message_update") {
|
||||
sessionManager.saveEvent(event);
|
||||
}
|
||||
});
|
||||
|
||||
// Route to appropriate mode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue