Skip to content

One malformed session_start recording bricks all --continue resume for a project (SessionDiscovery.listContinueTargets throws on any unreadable session file) #3732

Description

@acoliver

Summary

--continue (bare) and --continue <explicit-session-id> both crash with Cannot discover continue targets ... Invalid session_start: missing or malformed required fields when ANY single session recording in the project's chats dir has a malformed session_start record. One corrupt file (in this case a session-2026-09-17T20-08-46-*.jsonl left behind by a crashed/killed session) blocks resuming EVERY session in that project, including by explicit id where discovery of other candidates is unnecessary.

Repro (observed 2026-09-18, branch-5 working tree at ~ea297be0c + issue3663 changes)

  1. Have ≥1 valid session and ≥1 session file whose first record is not a well-formed session_start (observed after a hard-killed session from 2026-09-17).
  2. Run bun scripts/start.ts --continue <valid-session-id> --prompt ....
  3. Crash before the request is sent:
Error: Cannot discover continue targets: /Users/acoliver/Library/Logs/llxprt-code/tmp/<project-hash>/chats/session-2026-09-17T20-08-46-*.jsonl: Invalid session_start: missing or malformed required fields
    at listContinueTargets (packages/core/src/recording/SessionDiscovery.ts:149:17)

Impact

  • --continue <id>: the explicit id makes scanning other candidates unnecessary, but the scan still throws, so explicit resume is impossible until the corrupt file is manually removed.
  • Bare --continue: same total failure; a single unreadable file should not hide all healthy sessions.

Expected behavior

  • --continue <id> should resolve the explicit id without requiring every other file to parse (or at worst skip unreadable candidates).
  • Discovery should treat an unparseable/malformed session file as a non-candidate (skip with a debug log) rather than throwing for the whole listing. These are local tmp recordings; one damaged file (crash, disk-full, partial write) should not remove the resume feature for the project.

Environment

  • llxprt-code working tree (branch-5, issue3663 branch), macOS, sessions under ~/Library/Logs/llxprt-code/tmp/<hash>/chats/.

Workaround used

Moved the corrupt file out of the chats dir into a quarantine folder; resume works again.

Activity

  1. github-actions commented on Sep 18, 2026

    @github-actions
    Contributor

    LLxprt Issue Planner — infrastructure failure

    The planner did not produce output. Please inspect the workflow logs and re-run once resolved.

  2. acoliver commented on Oct 9, 2026

    @acoliver
    CollaboratorAuthor

    Still reproduces on 0.12.0-nightly.261009.6445094cf (installed build). After upgrading, --continue crashed in several projects with:

    Error: Cannot discover continue targets: .../chats/session-2026-10-08T21-18-08-6a0e7af5-520.jsonl: Invalid session_start: missing or malformed required fields
        at listContinueTargets (.../bundle/llxprt.js:219853:22)
    

    New detail: these files are not damaged by crashes. Our own writer produces them. The bad headers are well-formed JSON with "provider":"unknown","model":"", followed by a normal provider_switch and a full conversation. buildNewRecordingService in cliSessionBootstrap.ts records config.getProvider() ?? 'unknown' and config.getModel() before the profile's provider/model is applied, and handleSessionStart in ReplayEngine.ts then rejects the empty model.

    Count on one machine: about 20 such files across 10 project dirs, written between 2026-09-14 and 2026-10-08. Each one makes bare --continue and --continue <id> fatal for its whole project. Projects without one (for example uqm, branch-2) resume fine, including codex/gpt → claudecode/opus switches.

    Two fixes are needed: discovery should skip unreadable candidates instead of throwing (the original report), and the recorder should not write a session_start with an empty model.

  3. self-assigned this
    on Oct 9, 2026
  4. added 3 commits that reference this issue on Oct 9, 2026
    4063c73
    8025e5b
    b665470
  5. added a commit that references this issue on Oct 10, 2026
    c214b23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions