Skip to main content

compact_session_jsonl

Function compact_session_jsonl 

Source
pub fn compact_session_jsonl(path: &Path) -> Result<PathBuf>
Expand description

Compact a JSONL session file by replaying all operations into a single kind:0 snapshot. This works at the raw JSON level, preserving all fields VS Code expects. Returns the path to the compacted file.

Handles a common corruption pattern where VS Code appends delta operations to line 0 without newline separators (e.g., }{"kind":1,...}{"kind":2,...}).