[openclaw-plugin] Auto-capture injects "[tool: name]" text placeholder, polluting long-term memory and auto-recall
Bug
In examples/openclaw-plugin/text-utils.ts extractNewTurnMessages, when an assistant message contains only tool calls (no text content), the plugin synthesizes a placeholder text part:
text: `[tool: ${toolNamesStr}]`,
This placeholder is then sent to the OpenViking server via the auto-capture (afterTurn) path. The server's VLM extractor treats it as if it were real assistant text and persists it as a long-term memory entry. On the next session, auto-recall injects these poisoned memories into the context, causing downstream models to echo "[tool: exec]" literally and degrade.
Repro
- Install
@openviking/openclaw-pluginas a context-engine slot plugin - Use the OpenClaw gateway with any agent that calls tools frequently
- Send a few turns with tool calls
- Inspect
viking://user/default/memories/and search for\[tool: - Hundreds of matches will appear in both session
messages.jsonlfiles and extracted long-term memories
Expected
\[tool: ...]should never appear inmessages.jsonlassistant rows or in extracted memories- The server should not store this kind of metadata as content
Actual
- 726 matches across 64 session files and 119 matches across 25 long-term memory files in our deployment
- M3 (MiniMax) visibly echoes the pollution
Suggested fix
Replace the text placeholder with a structured type: "toolCall" part (the canonical format already used in context-engine.ts):
parts: toolNames.map((name) => ({ type: "toolCall", name }))
Plus a defensive regex in sanitizeUserTextForCapture to strip any legacy placeholder that may already exist in old data.
A reference patch is provided in the linked PR.
Environment
- OpenClaw 2026.6.2-beta.1
- openviking-server 0.3.24
- Plugin version 2026.5.8
- Ubuntu 24.04