Skip to content

skillopt-sleep harvest crashes when a transcript disappears during discovery #284

Description

@kaluli123123

Summary

The Claude and Codex transcript harvesters can abort an entire sleep cycle when a live session file is removed or rotated between directory discovery and mtime sorting.

Reproduction

On main at 79124b37e9a6371e13b753f8bcd7adb1e493ade1, make os.path.getmtime raise FileNotFoundError for one collected transcript path, or delete a collected file before sorting:

# harvest.py and harvest_codex.py currently sort with:
paths.sort(key=lambda p: os.path.getmtime(p), reverse=True)

The exception escapes before any digest is returned. This is reachable during normal live-session cleanup/rotation, not only through malformed input.

Expected behavior

A vanished transcript should be skipped and harvesting should continue with the remaining files, matching the existing defensive behavior in the Pi harvester.

Actual behavior

FileNotFoundError escapes from the sort key and aborts the harvest, so skillopt-sleep run cannot process the night's remaining sessions.

Impact

A concurrent session cleanup can turn an otherwise recoverable read race into a failed nightly run.

Environment

SkillOpt-Sleep on main at 79124b37e9a6371e13b753f8bcd7adb1e493ade1; reproducible with Python 3.10+ and a mocked disappearing transcript path.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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