Skip to content

Skip native JSONL files with no importable session header#57

Merged
luca-ctx merged 2 commits into
ctxrs:mainfrom
daisuke8000:fix/skip-unimportable-native-jsonl
Jul 5, 2026
Merged

Skip native JSONL files with no importable session header#57
luca-ctx merged 2 commits into
ctxrs:mainfrom
daisuke8000:fix/skip-unimportable-native-jsonl

Conversation

@daisuke8000

@daisuke8000 daisuke8000 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #56

Motivation

ctx import --provider cursor aborts when a transcript JSONL contains parseable rows but no importable session header, such as Cursor turn_ended / aborted-only stubs. The failure is reported as InvalidProviderTranscriptPath, 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 in summary.failures.

  • Cover Cursor aborted-only stubs in both tree import and explicit single-path import tests
  • Update the Gemini headerless native JSONL regression to the new behavior

Validation

  • cargo fmt --all -- --check
  • cargo test -p ctx-history-capture --test cursor_native --locked
  • cargo test -p ctx-history-capture --locked
  • cargo test -p ctx --test cli native_provider_cli

@daisuke8000 daisuke8000 force-pushed the fix/skip-unimportable-native-jsonl branch 2 times, most recently from 60e8328 to 977d67e Compare July 5, 2026 16:03
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>
@daisuke8000 daisuke8000 force-pushed the fix/skip-unimportable-native-jsonl branch from 977d67e to 45e065a Compare July 5, 2026 16:06
@luca-ctx luca-ctx force-pushed the fix/skip-unimportable-native-jsonl branch from 286b423 to fc5d2ce Compare July 5, 2026 21:06
@luca-ctx luca-ctx merged commit 443affb into ctxrs:main Jul 5, 2026
@luca-ctx

luca-ctx commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Merged with some additional tests, thank you for the fix!

@daisuke8000

Copy link
Copy Markdown
Contributor Author

@luca-ctx
Thanks for the merge and extra tests!
Appreciate your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ctx import aborts on Cursor aborted-only agent transcript stubs

2 participants