Skip native JSONL files with no importable session header#57
Merged
luca-ctx merged 2 commits intoJul 5, 2026
Merged
Conversation
60e8328 to
977d67e
Compare
Native JSONL importers can encounter stub files that parse as JSON but carry no session header, such as Cursor turn_ended/aborted-only transcripts. Returning InvalidProviderTranscriptPath aborted the whole provider import even when allow_partial_failures was enabled. Record these files as failed normalization results and continue the tree import instead. Empty native JSONL files are ignored. Antigravity keeps the existing empty-file error path. Add a Cursor provider-history fixture for the aborted stub case, extend the tree import regression to expect it alongside the malformed session, and add a single-file test mirroring the malformed JSONL coverage. Update the Gemini headerless native JSONL regression to match. Co-authored-by: Cursor <cursoragent@cursor.com>
977d67e to
45e065a
Compare
286b423 to
fc5d2ce
Compare
Contributor
|
Merged with some additional tests, thank you for the fix! |
Contributor
Author
|
@luca-ctx |
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.
Fixes #56
Motivation
ctx import --provider cursoraborts when a transcript JSONL contains parseable rows but no importable session header, such as Cursorturn_ended/ aborted-only stubs. The failure is reported asInvalidProviderTranscriptPath, so it aborts the provider import before partial-failure handling can keep processing the rest of the tree.Approach
Treat non-empty headerless native JSONL files as per-file normalization failures and return a summary instead of raising
InvalidProviderTranscriptPath. That lets tree imports keep valid transcripts while still surfacing the bad file insummary.failures.Validation
cargo fmt --all -- --checkcargo test -p ctx-history-capture --test cursor_native --lockedcargo test -p ctx-history-capture --lockedcargo test -p ctx --test cli native_provider_cli