Skip to content

fix(chisel): remove stale cache file when renaming a session #15796

Description

@Osraka

Reproduction

In the Chisel REPL:

!save first
!save second
!list

Both chisel-first.json and chisel-second.json are listed. The old file is also still loadable with !load first, even though the current session was renamed to second.

!load latest still selects the newest session, but the stale entry remains in the cache and makes session discovery misleading.

Expected behavior

When !save <new-id> renames an already saved session, the previous cache file should be removed after the new file is successfully written. Re-saving with the same ID should keep updating that file.

I have a focused regression test and a minimal fix ready that only changes the rename path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions