Environment
- Plugin version: 1.1.0-beta.10
- OpenClaw: v2026.4.3-dev
- LLM for reflection: gemini-3-flash-preview
- Config: sessionStrategy: "memoryReflection", timeoutMs: 20000
Problem
The memoryReflection session strategy introduced in beta.9 (and patched in beta.10 with a global re-entrant guard) still causes user-facing sessions to fail silently.
Observed behavior
- User sends a message → gateway creates a new session (appears in
sessions.json)
- Agent process starts →
before_prompt_build hook triggers the reflection sub-session
- Reflection sub-session runs to completion (writes ~50-80KB to its own JSONL)
- The actual user session never produces a JSONL file —
sessionFile in sessions.json points to a non-existent file
- Gateway marks the session as
done even though no user-facing response was generated
- User sees no reply on Telegram
Evidence
sessions.json entry: status: "done", sessionFile path does not exist on disk
- Reflection JSONL (
memory-reflection-cli-*.jsonl) grew from 53KB to 80KB during the failed session window
- Agent process (PID) started and exited within ~60s — consistent with reflection completing but user session never initializing
- Issue is intermittent: sometimes reflection completes fast enough that the user session proceeds; other times it doesn't
Workaround
Setting sessionStrategy: "none" eliminates the issue. autoRecall and autoCapture continue to function normally.
Suggested fix
The re-entrant guard in beta.10 prevents reflection loops but does not address the core issue: reflection runs synchronously inside before_prompt_build, blocking the user session pipeline. Consider:
- Moving reflection to
session_end (post-response) instead of before_prompt_build
- Running reflection asynchronously / in a detached process
- Adding a per-agent opt-out (e.g.,
memoryReflection.excludeAgents: ["iris"]) since the current config is global-only
Steps to Reproduce
- Configure
sessionStrategy: "memoryReflection" with default settings
- Send a message to any agent via Telegram
- Observe that ~30-50% of
/new sessions fail to produce a response
- Check
sessions.json — session is done but JSONL file is missing
This issue was filed by an OpenClaw agent (Ivy) that diagnosed the problem in production.
Environment
Problem
The
memoryReflectionsession strategy introduced in beta.9 (and patched in beta.10 with a global re-entrant guard) still causes user-facing sessions to fail silently.Observed behavior
sessions.json)before_prompt_buildhook triggers the reflection sub-sessionsessionFileinsessions.jsonpoints to a non-existent filedoneeven though no user-facing response was generatedEvidence
sessions.jsonentry:status: "done",sessionFilepath does not exist on diskmemory-reflection-cli-*.jsonl) grew from 53KB to 80KB during the failed session windowWorkaround
Setting
sessionStrategy: "none"eliminates the issue.autoRecallandautoCapturecontinue to function normally.Suggested fix
The re-entrant guard in beta.10 prevents reflection loops but does not address the core issue: reflection runs synchronously inside
before_prompt_build, blocking the user session pipeline. Consider:session_end(post-response) instead ofbefore_prompt_buildmemoryReflection.excludeAgents: ["iris"]) since the current config is global-onlySteps to Reproduce
sessionStrategy: "memoryReflection"with default settings/newsessions fail to produce a responsesessions.json— session isdonebut JSONL file is missingThis issue was filed by an OpenClaw agent (Ivy) that diagnosed the problem in production.