Skip to content

Session chat archiving mechanism #9

@jeffwweee

Description

@jeffwweee

Problem

Session files in state/sessions/{chat_id}.md grow indefinitely as conversation history accumulates. This bloats context and reduces performance.

Proposal

Implement an archiving mechanism with configurable thresholds:

Options to explore

  1. Time-based - Archive chats older than X days
  2. File size-based - Archive when file exceeds X KB
  3. File length-based - Archive when file exceeds X lines

Archive behavior

When threshold is reached:

  • Move old messages to state/sessions/archive/{chat_id}-{timestamp}.md
  • Keep recent N messages in active session file
  • Optionally compress archived files

Acceptance criteria

  • Archiving threshold configurable
  • Old messages moved to archive (not deleted)
  • Active session file stays manageable size
  • Archive files stored in dedicated directory

Related

  • Part of session management system
  • Helps with context window management

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions