fix(openclaw): harden 4Gi memory ceiling, increase liveness tolerance, add WAL checkpointing and cron delivery fix

This commit is contained in:
Moritz Graf
2026-10-03 08:03:18 +02:00
parent 4b85dd0eea
commit b6ed5fd00d
3 changed files with 49 additions and 1 deletions
+20 -1
View File
@@ -72,6 +72,24 @@ def main():
print(f"Compaction complete: {compacted} compacted, {skipped} skipped.")
# 3. Nightly SQLite WAL Checkpoint across all agent databases
print("=== Checkpointing SQLite WAL journals across all agent databases ===")
import glob, sqlite3, os
dbs = ["/home/node/.openclaw/state/openclaw.sqlite"] + glob.glob("/home/node/.openclaw/agents/*/agent/openclaw-agent.sqlite")
wal_freed = 0
for db in dbs:
wal = db + "-wal"
if os.path.exists(wal):
sz = os.path.getsize(wal)
try:
con = sqlite3.connect(db, timeout=15.0)
con.execute("PRAGMA wal_checkpoint(TRUNCATE);")
con.close()
wal_freed += sz
except Exception as e:
print(f" ✗ Error checkpointing {db}: {e}")
print(f"WAL Checkpoint complete: {wal_freed / (1024*1024):.2f} MB merged to disk.")
if __name__ == "__main__":
main()
EOF
@@ -83,10 +101,11 @@ echo "Registering OpenClaw Cron automation '$JOB_NAME' ($CRON_SCHEDULE @ $TIMEZO
kubectl exec -n "$NAMESPACE" "$POD_NAME" -c "$CONTAINER_NAME" -- openclaw cron add \
--name "Nightly Session Compaction" \
--declaration-key "$JOB_NAME" \
--description "Nightly multi-agent session compaction for all active topics and main sessions" \
--description "Nightly multi-agent session compaction and SQLite WAL checkpointing" \
--cron "$CRON_SCHEDULE" \
--tz "$TIMEZONE" \
--session "isolated" \
--no-deliver \
--command "python3 /home/node/.openclaw/scripts/compact_sessions.py"
echo "=== Compaction Cron automation successfully registered! ==="