Repository navigation
Treat unreadable TUI session JSON as non-empty so GC cannot drop it - #350
Merged
Merged
Conversation
session_json_is_empty treated json_parse failures (and non-object blobs) as empty transcripts, so Untitled 24h GC hard-deleted them and create_or_reuse overwrote the stored session. Fail closed: only a true empty object (or empty string) is empty. Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
This was referenced Sep 17, 2026
…e-error-not-empty # Conflicts: # CHANGELOG.md
tylerreckart
marked this pull request as ready for review
September 21, 2026 12:58
tylerreckart
enabled auto-merge (squash)
September 21, 2026 12:58
…e-error-not-empty # Conflicts: # CHANGELOG.md
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.
session_json_is_emptytreated ajson_parsethrow (and a non-object blob) as an empty transcript. Untitled conversations older than 24h were then hard-deleted on store open, andcreate_or_reusereused the row and overwrote the stored session.Fail closed: only an empty string or a JSON object with empty
index/agentscounts as empty. Truncated or non-object session JSON is kept. Canonical empty objects still reuse; 24h empty Untitled rows still GC.unit_conversation_store27/27 locally (+ ASan, 120 assertions). arbiter compiles.merge-tree vs main: CLEAN. vs #321–#349: CLEAN (including CHANGELOG this run). Isolated to
conversation_store.cpp/ its existing test file.Note
Low Risk
Localized change to empty-session detection in ConversationStore with regression tests; reduces risk of accidental data loss rather than introducing new behavior paths.
Overview
Unreadable TUI session blobs are no longer treated as empty transcripts.
session_json_is_emptynow fails closed: JSON parse errors and non-object shapes return non-empty, so only a blank string or a v2 object with emptyindex/agentscounts as empty.That stops 24h Untitled GC from hard-deleting conversations whose session JSON is truncated or corrupt, and stops
create_or_reusefrom reusing the active row and overwriting the stored blob. Canonical empty sessions still reuse; truly empty stale Untitled rows still GC.CHANGELOG updated;
unit_conversation_storeadds coverage for corrupt JSON, array-shaped sessions, and GC behavior.Reviewed by Cursor Bugbot for commit 918c0d4. Bugbot is set up for automated code reviews on this repo. Configure here.