Skip to content

fix: rotate oversized session files to prevent container timeouts#928

Open
kianwoon wants to merge 3 commits intoqwibitai:mainfrom
kianwoon:fix/session-rotation
Open

fix: rotate oversized session files to prevent container timeouts#928
kianwoon wants to merge 3 commits intoqwibitai:mainfrom
kianwoon:fix/session-rotation

Conversation

@kianwoon
Copy link
Copy Markdown

Summary

Fixes #697

Session conversation logs stored as JSONL files grow unbounded. When a session file exceeds ~5 MB, the container agent takes too long to load it on startup, causing timeouts and failed agent invocations.

Changes

  • Add maybeRotateSession() function to check session file size before spawning container
  • Rotate to new session ID when file exceeds 5 MB threshold
  • Old session files are preserved (not deleted) for reference
  • Added logging for session rotation events

Impact

  • Prevents bot silently failing to respond in active groups
  • No data loss - old session files remain intact
  • Transparent to users - new session ID is automatically generated

- Add session file size check before spawning container
- Rotate to new session ID when file exceeds 5 MB threshold
- Old session files are preserved (not deleted)
- Fixes qwibitai#697

Co-authored-by: Kian Woon <wiserly@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Fix Bug fix Status: Needs Review Ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Oversized JSONL session files cause container timeouts

2 participants