-
Notifications
You must be signed in to change notification settings - Fork 638
Memory lost on gateway restart: agent_end hook never fires #435
Copy link
Copy link
Open
Description
Problem
When the OpenClaw gateway restarts (SIGTERM), the agent_end hook never fires for active sessions. Since auto-capture only persists memories in agent_end, all conversation content from those sessions is lost.
Reproduction
- Have a conversation with the bot
- Restart gateway (
openclaw gateway restartor SIGTERM) - Check LanceDB — no new memories from that session
Root Cause
In index.ts, user messages are queued in autoCapturePendingIngressTexts via the message_received hook, but only processed (smart extraction + regex capture) in agent_end. If agent_end never fires (crash, restart, kill), the queue is lost.
Suggested Fix
- Eager capture option: Add a config like
eagerCapture: truethat does lightweight regex-based ingestion inmessage_received(no smart extraction needed), so at least raw facts are persisted immediately. - Graceful shutdown: Have the gateway flush pending ingest queues on SIGTERM before exiting.
Environment
- memory-lancedb-pro@1.1.0-beta.9
- OpenClaw gateway v2026.3.28
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels