Skip to content

Memory erase swallows cleanup errors with no retry, so derived data can be left behind #462

Open

Description

@itsskofficial

Raised by CodeRabbit on #453, but it predates that PR. erase() in sentient/memory/facts.py (~953-955) catches and drops errors from its cleanup steps (vectors, links, summaries, MEMORY.md/USER.md, insight evidence) with no retry. If one step fails (a locked file, a transient DB error), the memory row is gone but some derived data stays, and nothing ever tries again. This affects manual deletes and #441's expiry.

Fix: record failed cleanup steps (for example a small pending_erase table, or a retry list that the hourly memory upkeep drains) and retry them until they succeed. Log them plainly.

Done when: a test that makes one cleanup step fail once shows the derived data is removed on the next upkeep run.

Activity

  1. added
    bugSomething isn't working
    area: memoryFacts, user model, nightly consolidation
    priority: P2Later: useful, lower urgency
    size: SSmall: a few days
    on Oct 18, 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

    area: memoryFacts, user model, nightly consolidationbugSomething isn't workingpriority: P2Later: useful, lower urgencysize: SSmall: a few days

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions