fix(sessions): specify native duplicate identity handling - #1374
Merged
Merged
Conversation
…e id Session identity hashes the file path together with the header id, so a copy of a session .jsonl under the scan root (a backup, a manual copy) appeared as a second list entry for the same conversation (#1359). list() now dedupes by native header id and keeps the newest write, dropping stale duplicates from the records map so lookups cannot route to a dead copy. Stable ids are unchanged, so existing persisted references stay valid. Validated: native-pi-session tests 36/37; the single failure ("never deletes a foreign publication") reproduces on pristine main and is unrelated baseline noise. agent-runtime tsc clean apart from the same baseline.
Document the identity and preservation behavior expected when native transcript files share an id, and record the full user journey for the resulting projection.
This was referenced Oct 4, 2026
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.
This follow-up carries yexisu's original #1368 fix and synchronizes the storage contract and E2E plan.
The reported duplicate is real: session IDs include the file path, so copied native JSONL files can produce multiple rows for one native header ID. The implementation already deduplicates the scan result and preserves the selected file and stable persisted IDs. The added contract records the newest-transcript selection rule and confirms that discovery does not rewrite or delete copied files.
Validation:
git diff --checkpassed.origin/mainis an ancestor of this head; latest base is included.Supersedes #1368. Fixes #1359.