Skip to content

core: a crash during lease publish blocks log pruning for that session #313

Closed

Description

@ElbertePlinio

Found in the earlier review of #305, and it applies to the lease publish merged in #312 (#298).

createExclusiveHumanLeaseFile in packages/core/src/takeover.ts writes .human-lease-<uuid> and then links it to human.lease.json. If the process dies between those steps, the staging file stays in the session directory. retainSessionLogs removes permits and human.lease.json, but not staging files. pruneDirectory in packages/core/src/session-retention.ts then sees an unknown file and skips that retained session permanently, so its logs are never pruned.

  • Remove lease staging files when session logs are retained, after teardown has confirmed its processes are gone
  • Keep refusing to prune directories with other unknown files
  • Test: a retained session with an orphan lease staging file is pruned

Activity

  1. added
    bug
    on Oct 8, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions