Skip to content

[Bug] Session flush blocks write tool completely during compaction #63664

Description

@azure5100

Bug Description

During session compaction (flush), the write tool is completely blocked with error:
Memory flush writes are restricted to memory/YYYY-MM-DD.md; use that path only.

This makes it impossible to edit any file (including template.html, scripts, etc.) during flush, even when the file is unrelated to memory management.

Expected Behavior

  • Flush should only restrict writes to memory files as a preference/priority
  • The write tool should still be able to write to non-memory files when needed
  • OR: There should be a way to bypass this restriction when user explicitly allows it (e.g., typing '写' should allow writes to continue)

Actual Behavior

  1. Session context grows large → triggers compaction
  2. Write tool is locked to memory file only
  3. Even when user explicitly types '写' to unlock, the restriction is re-applied after just one or two messages
  4. This makes any file editing during active conversation nearly impossible

Impact

  • Cannot fix bugs or update files during normal conversation
  • Forces waiting for lengthy flush cycles
  • Severely impacts productivity when working on code/files

Suggested Fixes

  1. Option A: Make flush restriction a soft-limit (writes to non-memory files allowed but discouraged during flush)
  2. Option B: Add a config option to disable flush write restriction
  3. Option C: Allow user to send a magic word that grants write permission for N minutes
  4. Option D: When user sends '写', actually unlock writes for the remainder of the session

Version

OpenClaw latest (2026.04)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions