Skip to content

Memory cleanup: a save made during the cleanup is reverted with it when the loss guard trips #471

Closed

Description

@lydakis

Split out of #108, where it was declined on #123 as a race. It is worth tracking on its own now that more work runs overnight (nightly cleanup, self-set next looks, trigger agents).

What happens: cleanup_finish (client/src/memory.rs) runs git add -A and commits everything under ~/.agents/memory, then reverts that commit when the cleanup removed more than a quarter of the facts. A fact another agent saved between cleanup start and cleanup finish lands in that commit and is reverted with it. Git still holds it in the refused commit, but memory no longer does, and nothing tells the agent that saved it.

Done when: a save made while a cleanup is open survives a loss-guard revert. Either saves made during a cleanup are committed on their own before the cleanup's commit, or the revert covers only the cleanup's own changes. A test runs a save between start and a finish that trips the guard.

Activity

  1. added a commit that references this issue on Oct 31, 2026
    676cc50
  2. added 2 commits that reference this issue on Oct 31, 2026
    1a1d785
    9998e9e
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