Skip to content

continue recent can skip valid sessions with long headers #94577

Description

@rohitjavvadi

I found a resume edge case in the session manager.

A valid JSONL session file can be ignored by the recent-session scan when the first header line is longer than 512 bytes. The normal transcript loader can read the file, but findMostRecentSession() only read the first 512 bytes and tried to parse that truncated text as JSON. In a long workspace path, continueRecent() can then start a new session even though the previous transcript is still valid.

Repro shape:

  • create a session JSONL file with a long cwd in the session header
  • loadEntriesFromFile() returns the transcript entries
  • findMostRecentSession() does not pick that file on the old code path
  • SessionManager.continueRecent() starts a fresh session instead of resuming it

I have a focused fix and regression coverage for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions