Plugin no longer throws during register() when API key is missing.
Instead it registers successfully, logs a clear setup message with
the exact command to run, and disables memory features until configured.
Before: openclaw plugins install -> register() throws -> gateway logs error
After: openclaw plugins install -> registers ok -> logs setup instructions
Users see:
openclaw-mem0: API key not configured. Memory features are disabled.
To set up, run:
openclaw config set plugins.entries.openclaw-mem0.config.apiKey "m0-your-key"
openclaw gateway restart
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Write-only verification: only count memory_store, memory_update,
memory_forget, memory_delete_all as proof of dream execution.
Removed memory_list (read-only, orient-only pass should not count).
Scan only the last assistant message (this turn), not the full
session snapshot, to avoid matching earlier turns' tool calls.
2. Failed-turn cleanup: agent_end now handles dreamSessionId cleanup
BEFORE the !event.success early return. A failed/aborted turn
after lock acquisition releases the lock immediately instead of
waiting for the 1-hour stale timeout.
3. Atomic lock: replaced read-then-write with exclusive create flag
(wx). Two racing processes: only one succeeds, other gets EEXIST.
Stale locks are unlinked before the exclusive create attempt.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three fixes to the auto-dream gate mechanism:
1. Cheap gates first: checkCheapGates() (local file reads for time +
session count) runs BEFORE any API call. provider.getAll() only
executes if both cheap gates pass. Previously every turn downloaded
the entire memory set just to compute memCount.
2. Session-keyed dream tracking: dreamSessionId replaces the
process-global dreamJustRan boolean. Only the session that triggered
dream can complete it. Prevents cross-session false completion.
3. Verified completion: agent_end checks event.messages for actual
memory tool calls (memory_store, memory_update, memory_forget,
memory_list). If the model ignored the dream prompt and just
answered the user, the lock releases but completion is NOT recorded.
Gates will re-trigger on the next eligible turn.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>