openclaw - 💡(How to fix) Fix MEMORY.md bootstrap truncation silently drops context with no warning [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#71782Fetched 2026-04-26 05:08:24
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Code Example

workspace bootstrap file MEMORY.md is 14296 chars (limit 12000); truncating in injected context
RAW_BUFFERClick to expand / collapse

Bug Summary

Symptom

On agent session start, the workspace bootstrap file is truncated in injected context:

workspace bootstrap file MEMORY.md is 14296 chars (limit 12000); truncating in injected context

Impact

The agent loses the tail of its MEMORY.md on every session, silently dropping memory entries that appear later in the file. There is no warning to the user or the agent that context is incomplete.

Suggested Fix

Either:

  1. Raise the limit to accommodate larger memory files
  2. Surface a user-facing warning when the file exceeds the limit (so the user knows to trim it)
  3. Inject a truncation notice into the agent context itself so the agent is aware it may be missing entries rather than assuming its memory is complete

Option 3 is the minimum viable fix — the agent should never silently assume its memory is complete when it isn't.

extent analysis

TL;DR

Implementing a truncation notice in the agent context is the most straightforward fix to ensure the agent is aware of potential missing memory entries.

Guidance

  • Identify the current limit (12000 chars) and assess whether raising it is feasible and sufficient to accommodate typical MEMORY.md file sizes.
  • Consider adding a user-facing warning when the file approaches or exceeds the limit to prompt users to manage their memory files.
  • Inject a truncation notice into the agent context to notify it of potential incomplete memory, as suggested in Option 3 of the issue.
  • Evaluate the impact of silently dropped memory entries on agent functionality and user experience to determine the best long-term solution.

Example

No specific code example is provided due to the lack of implementation details, but the fix would involve modifying the code that handles the injection of the workspace bootstrap file into the agent context to include a notice when truncation occurs.

Notes

The ideal solution depends on the typical size of MEMORY.md files and the consequences of truncation. Raising the limit might be a temporary fix if files continue to grow, while surfacing a warning to the user or injecting a truncation notice provides more immediate feedback on potential issues.

Recommendation

Apply workaround: Inject a truncation notice into the agent context. This approach ensures the agent is aware of potential missing entries without requiring immediate changes to the limit or user-facing warnings, addressing the immediate need for the agent to not silently assume its memory is complete.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING