Skip to content

Bug: session-memory hook (and command-logger) do not fire on /new or /reset commands #23027

@makeorbreakshop

Description

@makeorbreakshop

Summary

The session-memory and command-logger bundled hooks are configured and show as ✓ ready in openclaw hooks list, but neither hook fires when /new or /reset is issued via Discord.

Environment

  • OpenClaw version: 2026.2.21-2
  • OS: macOS (Darwin 25.2.0, arm64)
  • Channel: Discord (DM)
  • Agent: agent:main:main

Configuration

Both hooks are enabled in openclaw.json:

{
  "hooks": {
    "internal": {
      "entries": {
        "session-memory": {
          "enabled": true,
          "messages": 25
        }
      }
    }
  }
}

openclaw hooks list output:

Hooks (4/4 ready)
✓ ready  💾 session-memory   Save session context to memory when /new or /reset command is issued
✓ ready  📝 command-logger   Log all command events to a centralized audit file

Steps to Reproduce

  1. Start a session via Discord DM
  2. Issue /new command
  3. Session resets correctly (new session ID is created, transcript file is rotated to .reset.*)

Expected Behavior

  • command-logger appends a JSON line to ~/.openclaw/logs/commands.log
  • session-memory creates a dated slug file in <workspace>/memory/YYYY-MM-DD-<slug>.md

Actual Behavior

  • ~/.openclaw/logs/commands.log is empty / not created
  • No memory slug file is created in memory/
  • No session-memory or command-logger entries appear in gateway logs
  • The command:new event appears to never fire despite the session reset occurring successfully

Evidence

  • Session was reset at 2026-02-21T21:13:04Z (confirmed via .reset. file: 789a368a-4877-4b12-af11-2858a4d49c48.jsonl.reset.2026-02-21T21-13-04.878Z)
  • Gateway log around reset time shows normal session rotation but zero hook-related entries
  • commands.log file is empty — confirming the command:new event is not being dispatched to hooks at all

Notes

The gateway was restarted immediately before the /new was issued (config change prompted a restart). Hooks showed ready after restart. The session itself reset cleanly. The hook event dispatch step appears to be silently skipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions