説明なし

Lukas Goldschmidt 6b59349aba Harden assistant text extraction 1 ヶ月 前
PROJECT.md 4a8732cf1c first commit 1 ヶ月 前
README.md 352c3b581f Document v1.0.0 release 1 ヶ月 前
index.ts 6b59349aba Harden assistant text extraction 1 ヶ月 前
openclaw.plugin.json 4a8732cf1c first commit 1 ヶ月 前
package.json 4a8732cf1c first commit 1 ヶ月 前

README.md

chat-logger-plugin

Version: v1.0.0

Logs recent chat turns to /tmp/openclaw-chat.log so the mem0 auto-capture hook can attach the previous assistant reply when storing conversational memories.

What it does

  • Listens to session_start, message_received, and agent_end events
  • Resolves the best available sessionKey and caches it
  • Writes the last two turns (user + assistant) to /tmp/openclaw-chat.log

Why it matters

The mem0 hook reads the log to retrieve the last assistant reply and include it in the capture payload. This avoids losing context when auto-capturing a new user message.

Output format

Each log line is a JSON object:

{
  "ts": "2026-03-16T02:30:46.827Z",
  "sessionKey": "agent:main:main",
  "messages": [
    { "role": "user", "content": "..." },
    { "role": "assistant", "content": "..." }
  ]
}

Install / reload

1) Edit in workspace/chat-logger-plugin/ 2) Restart gateway so the plugin is reloaded

Related

  • Hook: workspace/hooks/mem0-auto-capture/hook/handler.ts
  • The hook falls back to the latest assistant message if sessionKey is missing.