picoclaw/pkg/memory
xiaoen e810331dd8 fix(memory): use SetHistory in migration for crash idempotency
MigrateFromJSON previously called AddFullMessage in a loop, then
renamed the .json file to .json.migrated. If the process crashed
after appending some messages but before the rename, a retry would
re-read the same .json and append all messages again — duplicating
whatever was written before the crash.

Switch to SetHistory which atomically replaces the session contents.
A retry after crash overwrites the partial data instead of appending.
2026-02-26 16:15:11 +08:00
..
jsonl.go fix(memory): write meta before JSONL rewrite for crash safety 2026-02-26 16:13:57 +08:00
jsonl_test.go fix(memory): always reconcile line count in TruncateHistory 2026-02-26 16:12:34 +08:00
migration.go fix(memory): use SetHistory in migration for crash idempotency 2026-02-26 16:15:11 +08:00
migration_test.go fix(memory): use SetHistory in migration for crash idempotency 2026-02-26 16:15:11 +08:00
store.go feat(memory): add Compact method for physical JSONL compaction 2026-02-26 08:42:35 +08:00