fix(sessions): preserve populated sessions during automatic cleanup - #755
Merged
Merged
Conversation
Prevent creating a new conversation from deleting populated sessions whose cached creation and update timestamps still match. Automatic cleanup now checks fresh, unfiltered native messages and preserves drafts, attachments, pending activity, queued input and child sessions. Failed or obsolete reads never authorize deletion, and the message check is refreshed before dispatch. Run automatic cleanup outside the creation and first-send critical path. Coalesce sweeps per connection, capture candidates synchronously, and fence reconnects and local activity. Keep the explicitly confirmed deep-clean policy separate and count only successful deletions. Add 40 cleanup regressions and an isolated native fixture to minimum/latest runtime CI. The fixture reproduces native data loss on the baseline and passes on OpenCode 2.0.7 and 2.0.14. All 157 targeted tests and UI/Electron typechecks pass. Two independent gatekeeper rounds concluded with zero findings after fixing the historical-scan responsiveness issue.
Contributor
Author
|
I am admin-merging the reviewed 4d33c5e head after the local validation and zero-finding gatekeeper review recorded above. The full GitHub Actions run is still in progress: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/35845489242. I am not treating pending CI checks as passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #754.
I reproduced real native data loss: creating another session deleted a populated conversation because its cached creation and update timestamps still matched.
I replaced that heuristic with fresh native content checks. Automatic cleanup preserves local drafts and attachments, pending activity, queued input and child sessions. Failed or stale checks do not authorize deletion. The explicitly confirmed deep-clean command keeps its separate policy.
I moved automatic cleanup off the creation/first-send critical path and coalesced overlapping sweeps per connection.
Validation
Review
I ran two independent gatekeeper rounds. The first found a responsiveness issue in the historical scan; I fixed it and added a stalled-read/first-send regression. The second reported zero findings.
CI status is tracked below; the validation results above are local.