fix(store): synthesize session ID when empty in claude_code, codex, and pi - #63
Open
Adityakk9031 wants to merge 3 commits into
Open
Adityakk9031 wants to merge 3 commits into
Adityakk9031 wants to merge 3 commits into
Conversation
Collaborator
|
The generated ID doesn't survive save/load consistently for Claude and Codex. The reloaded ID differs from |
Contributor
Author
|
Updated to stamp synthesized session IDs directly into the native records/rollout lines when saving for Claude Code and Codex, and added assertions verifying that |
This branch has not been deployed
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.
Summary
When continuing, translating, or saving transcripts without an explicit ID (such as via standard input with
txcript continue - --with <harness>or when converting from a harness that doesn't carry an ID),ClaudeStore::save,CodexStore::save,pi::write_session(used by both Pi and Campfire), andlocal::materialize_artifacts_for_claude_codewould panic/error with:Other stores (
Cursor,Fx,Grok,Antigravity) already safely synthesize aUuid::new_v4()fallback whenmeta.idis empty before enforcing path safety checks viachecked_id_component.Changes
ClaudeStore::saveandlocal::materialize_artifacts_for_claude_code, generate a fresh UUID whenmeta.idis empty. Stamp the synthesized ID into the transcript so both the JSONL records and the filename share the exact same session identity for proper session resumption.CodexStore::save, synthesize a UUID whenmeta.id.is_empty(), stamping the ID into the transcript so thesession_metaline inside the rollout matches the filename.pi::write_session, synthesize a UUID whenmeta.id.is_empty()and patch the leadingRecord::Sessionheader if present so the in-file ID matches the filename on disk.