MemPalace/mempalace · error · MaxSeqIdVerificationError

Post-repair detection still found {len(remaining)} poisoned

Error message

Post-repair detection still found {len(remaining)} poisoned row(s): {[sid for sid, _ in remaining]}. Backup at {result['backup']}.

What it means

Error "Post-repair detection still found {len(remaining)} poisoned row(s): {[sid for sid, _ in remaining]}. Backup at {result['backup']}." thrown in MemPalace/mempalace.

Source

Thrown at mempalace/repair.py:2392

        )

    _close_chroma_handles(palace_path)

    with sqlite3.connect(db_path) as conn:
        conn.execute("BEGIN")
        try:
            conn.executemany(
                "UPDATE max_seq_id SET seq_id = ? WHERE segment_id = ?",
                [(new_val, seg_id) for seg_id, _old, new_val in plan],
            )
            conn.commit()
        except Exception:
            conn.rollback()
            raise

    remaining = _detect_poisoned_max_seq_ids(db_path, segment=segment, threshold=threshold)
    if remaining:
        raise MaxSeqIdVerificationError(
            f"Post-repair detection still found {len(remaining)} poisoned row(s): "
            f"{[sid for sid, _ in remaining]}. Backup at {result['backup']}."
        )

    result["segment_repaired"] = [seg_id for seg_id, _old, _new in plan]
    print(f"\n  Repair complete. {len(plan)} row(s) restored.")
    print(f"  Backup:  {result['backup'] or '(skipped)'}")
    print(f"\n{'=' * 55}\n")
    return result


if __name__ == "__main__":
    p = argparse.ArgumentParser(description="MemPalace repair tools")
    p.add_argument("command", choices=["status", "scan", "prune", "rebuild"])
    p.add_argument("--palace", default=None, help="Palace directory path")
    p.add_argument("--wing", default=None, help="Scan only this wing")
    p.add_argument("--confirm", action="store_true", help="Actually delete corrupt IDs")
    args = p.parse_args()

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Investigate the remaining poisoned rows; the backup is preserved at the reported path

When it happens

Trigger: Thrown at mempalace/repair.py:2392 when the library encounters an invalid state.

Common situations: Repair pass completed but poisoned rows remained.


AI-assisted analysis of MemPalace/mempalace@06cb6987f0 (2026-08-15). Data as JSON: /api/errors/d75840ec82abda71. Report an issue: GitHub.