openclaw - ✅(Solved) Fix [Bug]: Default memory convention and session-memory hook output are inconsistent (YYYY-MM-DD.md vs YYYY-MM-DD-slug.md) [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61384Fetched 2026-04-08 02:59:10
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

(Thanks Krill for drafting the entire thing for me)

With default AGENTS instructions + bundled session-memory hook enabled, /reset saves to memory/YYYY-MM-DD-slug.md but the next session startup still tries to read memory/YYYY-MM-DD.md (today/yesterday), causing repeat ENOENT read errors.

Error Message

Severity: Low-to-medium (no crash, but noisy/error-looking logs and confusing memory behavior)

Root Cause

(Thanks Krill for drafting the entire thing for me)

With default AGENTS instructions + bundled session-memory hook enabled, /reset saves to memory/YYYY-MM-DD-slug.md but the next session startup still tries to read memory/YYYY-MM-DD.md (today/yesterday), causing repeat ENOENT read errors.

PR fix notes

PR #62298: fix(hooks): align session-memory filename with canonical YYYY-MM-DD.md convention

Description (problem / solution / changelog)

Summary

Fixes #61384

The session-memory hook wrote files as YYYY-MM-DD-slug.md while flush-plan, AGENTS templates, and post-compaction context all expect YYYY-MM-DD.md. This mismatch caused ENOENT errors after /reset when the agent tried to read the canonical daily file.

  • Use canonical YYYY-MM-DD.md filename (slug moved into ## Session: heading for descriptive context)
  • Respect user timezone via Intl.DateTimeFormat (matching flush-plan and post-compaction context)
  • Append to existing daily file on multiple /reset calls in the same day (separated by ---)
  • Nest ### Conversation Summary under ## Session: heading for proper hierarchy
  • Only catch ENOENT on existing-file read; re-throw real errors
  • Update HOOK.md to reflect new filename convention and append behavior

Test plan

  • Existing tests pass (19/19)
  • New test: verifies canonical YYYY-MM-DD.md filename without slug suffix
  • New test: verifies multiple resets append to the same daily file with --- separator

Changed files

  • src/hooks/bundled/session-memory/HOOK.md (modified, +11/-9)
  • src/hooks/bundled/session-memory/handler.test.ts (modified, +61/-0)
  • src/hooks/bundled/session-memory/handler.ts (modified, +51/-10)

Code Example

[hooks/session-memory] Session context saved to ~/.openclaw/workspace/memory/2026-04-04-heartbeat-review.md
[tools] read failed: ENOENT ... /memory/2026-04-04.md
[tools] read failed: ENOENT ... /memory/2026-04-03.md

---

Observed sequence in logs:

[hooks/session-memory] Session context saved to ~/.openclaw/workspace/memory/2026-04-04-heartbeat-review.md
[tools] read failed: ENOENT ... /memory/2026-04-04.md
[tools] read failed: ENOENT ... /memory/2026-04-03.md
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

(Thanks Krill for drafting the entire thing for me)

With default AGENTS instructions + bundled session-memory hook enabled, /reset saves to memory/YYYY-MM-DD-slug.md but the next session startup still tries to read memory/YYYY-MM-DD.md (today/yesterday), causing repeat ENOENT read errors.

Steps to reproduce

  1. Use default workspace template/AGENTS instructions (the ones referencing memory/YYYY-MM-DD.md for daily notes).
  2. Ensure bundled hook session-memory is enabled.
  3. In chat, run /reset.
  4. Check logs.

Expected behavior

Default memory conventions should be aligned so /reset does not produce avoidable ENOENT reads from missing memory/YYYY-MM-DD.md when hook output is memory/YYYY-MM-DD-slug.md.

Actual behavior

Observed sequence in logs:

[hooks/session-memory] Session context saved to ~/.openclaw/workspace/memory/2026-04-04-heartbeat-review.md
[tools] read failed: ENOENT ... /memory/2026-04-04.md
[tools] read failed: ENOENT ... /memory/2026-04-03.md

OpenClaw version

2026.3.28

Operating system

Docker

Install method

No response

Model

google-vertex/gemini-2.5-flash

Provider / routing chain

NOT_ENOUGH_INFO

Additional provider/model setup details

NOT_ENOUGH_INFO

Logs, screenshots, and evidence

Observed sequence in logs:

[hooks/session-memory] Session context saved to ~/.openclaw/workspace/memory/2026-04-04-heartbeat-review.md
[tools] read failed: ENOENT ... /memory/2026-04-04.md
[tools] read failed: ENOENT ... /memory/2026-04-03.md

Impact and severity

Affected: users running default templates + session-memory hook Severity: Low-to-medium (no crash, but noisy/error-looking logs and confusing memory behavior) Frequency: Reproducible on each reset when date files are absent Consequence: confusion during troubleshooting and unclear default memory expectations

Additional information

This appears to be a default-convention mismatch rather than an isolated runtime failure.

extent analysis

TL;DR

Update the default AGENTS instructions to match the file naming convention used by the session-memory hook, which includes a slug in the filename.

Guidance

  • Review the default workspace template and AGENTS instructions to ensure they align with the expected output of the session-memory hook.
  • Verify that the session-memory hook is correctly configured and enabled.
  • Consider updating the session-memory hook to handle cases where the expected file does not exist, to prevent ENOENT read errors.
  • Check the logs to confirm that the issue is resolved after making changes to the default AGENTS instructions or session-memory hook configuration.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather a configuration or template update.

Notes

The issue appears to be related to a mismatch between the default AGENTS instructions and the session-memory hook's output. Resolving this issue may require updates to the default template or hook configuration. The provided information does not specify the exact changes required, so further investigation may be necessary.

Recommendation

Apply a workaround by updating the default AGENTS instructions to match the file naming convention used by the session-memory hook, as this is a low-to-medium severity issue and does not require an immediate upgrade to a fixed version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Default memory conventions should be aligned so /reset does not produce avoidable ENOENT reads from missing memory/YYYY-MM-DD.md when hook output is memory/YYYY-MM-DD-slug.md.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING