Skip to content

fix(openclaw-plugin): sanitize memory_store input to prevent context pollution#1031

Open
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/sanitize-memory-store-input
Open

fix(openclaw-plugin): sanitize memory_store input to prevent context pollution#1031
mobilebarn wants to merge 1 commit intovolcengine:mainfrom
mobilebarn:fix/sanitize-memory-store-input

Conversation

@mobilebarn
Copy link
Copy Markdown

Summary

  • Applies sanitizeUserTextForCapture to the memory_store tool's text input before sending it to OpenViking, preventing <relevant-memories> blocks and other injected metadata from polluting the memory extraction pipeline.
  • Returns an early rejection when the input is empty after sanitization (metadata-only content).
  • Uses the sanitized text length in log messages for accurate diagnostics.

Closes #898

Test plan

  • Call memory_store with text containing <relevant-memories>...</relevant-memories> blocks and verify they are stripped before storage
  • Call memory_store with text that is entirely metadata and verify the tool returns the "Nothing to store" rejection
  • Call memory_store with clean text and verify it stores normally without modification
  • Verify existing auto-capture path still works as before (no regression)

…pollution

Applies sanitizeUserTextForCapture to the memory_store tool's text input,
preventing <relevant-memories> blocks and metadata from polluting the
memory extraction pipeline.

Closes volcengine#898
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

OpenClaw plugin auto-capture may mis-capture <relevant-memories> injected context and intermittently fail with AbortError on OpenClaw v2026.3.13

1 participant