Skip to content

Refactor session persistence to async debounced writes#148

Merged
LIU9293 merged 4 commits intomainfrom
feat/async-session-persistence-265899
Feb 25, 2026
Merged

Refactor session persistence to async debounced writes#148
LIU9293 merged 4 commits intomainfrom
feat/async-session-persistence-265899

Conversation

@LIU9293
Copy link
Contributor

@LIU9293 LIU9293 commented Feb 25, 2026

Summary

  • replace synchronous session file writes with an async per-session write queue
  • add a 5s debounce for active request updates to reduce write amplification under live status updates
  • stop persisting activeRequest.tools to disk and sanitize update payloads to keep session snapshots small
  • harden session delete/write races so in-flight writes cannot recreate deleted session files

Validation

  • bun test packages/core/test

Reduce runtime blocking by replacing sync session writes with a 5s async debounce queue and avoid persisting verbose tool traces to disk.
Delete session persistence files when lastActivityAt is older than seven days and add coverage for stale/recent retention behavior.
Batch frequent settings.json updates into async non-blocking writes to reduce sync disk churn during active chat traffic.
@LIU9293 LIU9293 merged commit 35f2e5e into main Feb 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant