Skip to content

[Bug]: MEMORY.md grows unbounded → bootstrap overflow → Gateway freeze #73691

@yangdoom007

Description

@yangdoom007

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

MEMORY.md grows unbounded with no size guard. After extended use, exceeds bootstrap hard limit (default 12KB per file / 60KB total), causing session write-lock timeout and Gateway freeze.

Steps to reproduce

  1. Enable dreaming via plugins.entries.memory-core.config.dreaming.enabled: true
  2. Use normally for weeks; deep phase promotes entries repeatedly
  3. MEMORY.md grows from ~5KB to 50KB+
  4. New session bootstrap injection fails silently or triggers session-write-lock timeout
  5. Gateway becomes unresponsive — requires hard restart

Expected behavior

MEMORY.md stays within bootstrap limits (e.g., 12KB per file). Dreaming promotions either compact existing content, archive old entries, or write to a separate layer so bootstrap context remains bounded.

Actual behavior

MEMORY.md grows to 50KB–100KB+. New sessions trigger session-write-lock timeout (121s), completely freezing the Gateway. Affected users cannot send messages until the Gateway process is hard-killed and restarted.

OpenClaw version

2026.4.26 (be8c246)

Operating system

macOS 15.4 (Darwin 25.3.0, Apple Silicon M4)

Install method

No response

Model

minimax/MiniMax-M2.7

Provider / routing chain

openclaw -> direct to minimax (api.minimaxi.com)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: OpenClaw users with dreaming enabled
Severity: High (completely blocks Gateway, requires hard restart)
Frequency: Progressive (grows over weeks of use)
Consequence: Gateway freeze → no messages processed → automation failures (stock alerts, flight monitoring, etc.)

Additional information

Root cause: Deep phase is append-only with no pre-write size check, compaction, or archival strategy.

Suggested fixes (pick one or combine):

A) Promotion size check + auto-compaction
Before deep phase writes MEMORY.md, check size. If > threshold (e.g. 15KB), auto-compact: merge duplicates, drop low-value entries, summarize old ones. Standard memory GC.

B) Archive layer (recommended)
Separate active memory (MEMORY.md) from history archive (memory/archive/YYYY-MM.md). Promotion writes to active layer only; history goes to archive. Bootstrap only injects active layer.

C) Structured memory replacing append-only
Switch MEMORY.md to structured format (JSON/NDJSON) supporting update/delete/priority. Promotion can overwrite old entries instead of always appending.

Workaround: Manually truncate MEMORY.md and disable dreaming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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