soul: persist sessions across restarts via local snapshot
On startup, prefer the local engram snapshot if it has >50 nodes. HTTP Engram is only used on first boot (no snapshot yet). This means sessions, conversation history, and in-process state survive daemon restarts. awareness.el: sync source with compiled binary (periodic mem_save on heartbeat was already in the binary but not in source). Rebuilds soul.c with the new startup logic and ships updated binary.
This commit is contained in:
@@ -440,6 +440,12 @@ fn awareness_run() -> Void {
|
||||
if should_beat {
|
||||
emit_heartbeat()
|
||||
state_set("soul.last_beat_ts", int_to_str(now_ts))
|
||||
// Persist in-process Engram (sessions, memories, conversation nodes)
|
||||
// to local snapshot so they survive restarts.
|
||||
let snap_path: String = state_get("soul_snapshot_path")
|
||||
if !str_eq(snap_path, "") {
|
||||
mem_save(snap_path)
|
||||
}
|
||||
}
|
||||
|
||||
// Curiosity scan: idle-gated AND wall-clock based. Only fires when the
|
||||
|
||||
Reference in New Issue
Block a user