Hindsight plugin retain silently fails on OpenClaw 2026.9.6 — session_end hook fires but event carries no messages
Bug Description
Hindsight plugin (v0.13.0) auto-retain is completely broken on OpenClaw 2026.9.6. Auto-recall works correctly, but auto-retain never writes anything to the Hindsight database.
Verification method:
- Send a unique test token in a Feishu conversation (e.g. "紫电青霜 - 狐狸过桥 - 20260926-1955")
- Wait for the conversation to settle
- Open a new session with /new
- Ask "what was the previous memory test token?"
- The agent cannot recall it from Hindsight
The only reason the agent can "find" the token in the same session is OpenClaw's sessions_search (full-text search over raw transcript), NOT Hindsight recall. This was confirmed by the agent itself:
"Hindsight recall 和本地 memory 文件里没有这条本体,说明它目前是靠会话历史检索找到的,不是被固化进长期记忆。"
Environment:
- OpenClaw: 2026.9.6
- @vectorize-io/hindsight-openclaw: 0.13.0
- Hindsight API: 0.10.1 (external API mode)
- OS: Linux 6.6.87.2 (WSL2)
- Node: 24.21.0
- LLM: kimi/k3
Tested with two agents (main and medical) on two separate Feishu accounts. Both fail identically.
Steps to Reproduce
Install OpenClaw 2026.9.6
Install @vectorize-io/[email protected]
Configure Hindsight plugin in openclaw.json: { "hindsight-openclaw": { "enabled": true, "hooks": { "allowConversationAccess": true }, "config": { "hindsightApiUrl": "http://localhost:8889", "dynamicBankId": true, "autoRetain": true, "autoRecall": true, "enableKnowledgeTools": true, "debug": true, "dynamicBankGranularity": ["agent"], "recallTypes": ["world", "experience", "observation"], "retainEveryNTurns": 1, "retainOverlapTurns": 0, "recallInjectionPosition": "append" } } }
Configure hooks to disable session-memory (required for Hindsight to work in 5.20): { "hooks": { "internal": { "enabled": true, "entries": { "session-memory": { "enabled": false } } } } }
Start Gateway
Send a message via Feishu with a unique token: "新测试暗号:青霜紫电-测试-20260926,请回复确认"
Wait for the agent to reply
Open a new session: /new
Ask: "新测试暗号是什么?"
Agent cannot answer from Hindsight recall
Check logs: grep -i "session_end" /tmp/openclaw/openclaw-YYYY-MM-DD.log
Expected Behavior
After sending the test token, Hindsight's session_end hook should:
- Fire with a populated event containing the conversation transcript
- Retain the conversation to the Hindsight database
- Be retrievable in a later session via auto-recall
The following log line should NOT appear: [Hindsight Hook] No messages in event, skipping retention
Actual Behavior
The session_end hook fires, but the event carries no messages:
2026-09-26T18:01:16.621+08:00 info plugins hindsight: [Hindsight Hook] session_end triggered - bank: main 2026-09-26T18:01:16.622+08:00 info plugins hindsight: [Hindsight Hook] No messages in event, skipping retention
2026-09-26T18:01:22.591+08:00 info plugins hindsight: [Hindsight Hook] session_end triggered - bank: medical 2026-09-26T18:01:22.592+08:00 info plugins hindsight: [Hindsight Hook] No messages in event, skipping retention
This matches the description of PR #4348: fix(openclaw): read the transcript session_end does not carry (merged 2026-09-15)
The fix is NOT included in 0.13.0.
Additional finding: When memory.search block exists in openclaw.json, the session_end hook does not even fire. Removing memory.search makes it fire — but with empty events.
With memory.search present: - session_end hook NEVER fires (no log output at all) With memory.search removed: - session_end hook fires - but event has no messages → retain skipped
However, deleting memory.search alone does not fix retain — the event is still empty.
Retain summary log (misleading, does not reflect actual conversation retention): hindsight: 2 recalls (16 memories injected), 2 retains (18 messages captured) in 539s (banks: main, medical)
The "2 retains" here are operational sessions (cron/heartbeat), not the actual user conversations. Confirmed by: hindsight: Skipping retain on session 'agent:main:cron:...': operational session
Version
OpenClaw: 2026.9.6 @vectorize-io/hindsight-openclaw: 0.13.0 Hindsight API: 0.10.1 Node: 24.21.0 OS: Linux 6.6.87.2 (WSL2) LLM provider: kimi (Kimi Coding) Channel: Feishu (3 accounts)
LLM Provider
Other
Source: vectorize-io/hindsight