Skip to content

Discard history this build cannot open when a chat is deleted - #713

Closed
Varuas37 wants to merge 3 commits into
cursor/session-record-version-ed67from
cursor/discard-unreadable-history-ed67
Closed

Varuas37 wants to merge 3 commits into
cursor/session-record-version-ed67from
cursor/discard-unreadable-history-ed67

Conversation

@Varuas37

@Varuas37 Varuas37 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What changed

Deleting a chat whose history cannot be opened now drops that container instead of leaving the deletion incomplete.

SessionStorage::discard_unreadable removes a legacy JSONL file and resets a stream whose prefix does not start at zero, without folding the retained bytes. A later open of the reset stream is an empty published session. The trait default refuses with StorageError::Corrupt. An adapter that can hold unreadable history has to override it, or the delete stays incomplete and the file stays. RecordStorage overrides it. In-memory storage keeps the refusal.

The conversation service calls this only when opening the history returns Corrupt or AnotherVersion. A busy lease stays leased-elsewhere. Any other discard error stays on the deletion. When the provider link was still unread, the tombstone records that the history was lost.

A semantic record this build cannot decode still opens as a placeholder, so delete takes the normal lease and erases it. This path is the history that never opens: legacy JSONL, and a stream whose saved prefix is gone.

Tests

  • memory_storage_refuses_to_discard_unreadable_history locks the refusing default.
  • discard_unreadable_removes_legacy_jsonl_and_resets_a_predecessor_stream removes the JSONL file and resets a pruned prefix.
  • deleting_a_legacy_jsonl_chat_removes_it finishes the delete and the file is gone.

An issue for this split could not be opened from this environment. GitHub access here is read-only.

Scripted gateway checks

This pull request changes how a delete treats history that cannot be opened. The scripted gateway summary is not part of it.

Open in Web Open in Cursor 

Legacy JSONL and a stream whose prefix does not start at zero cannot be
opened. Delete drops that container without folding it. An adapter that
does not override discard_unreadable leaves the deletion incomplete.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>
@Varuas37 Varuas37 added the cursor Cursor is working on this label Oct 9, 2026 — with Cursor
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

cursoragent and others added 2 commits October 9, 2026 10:18
Co-authored-by: Saurav  <saurav.panthee@gmail.com>
Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Varuas37 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded: the minimal delete fix for unreadable chats is going into #717. This PR was built on the parked #695 branch and assumed placeholder reads (now #716). Closing. The branch is kept for reference.

@Varuas37 Varuas37 closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor Cursor is working on this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants