Skip to content

fix(openclaw): prevent extraction of standalone timestamps as memories#4550

Merged
whysosaket merged 1 commit intomainfrom
fix/openclaw-timestamp-extraction
Mar 26, 2026
Merged

fix(openclaw): prevent extraction of standalone timestamps as memories#4550
whysosaket merged 1 commit intomainfrom
fix/openclaw-timestamp-extraction

Conversation

@chaithanyak42
Copy link
Copy Markdown
Contributor

Summary

  • Add explicit exclude rule to OpenClaw plugin's custom extraction instructions to prevent the LLM from storing standalone timestamps as durable memories
  • Timestamps anchoring real facts (e.g., "User installed Ollama on 2026-03-21") are still preserved

Problem

OpenClaw injects the current time into every message as context for the agent. The extraction LLM sees this and stores "User indicates current time is 3:25 PM" as a permanent memory. This happens every 10-30 minutes for active users.

Prod data evidence:

  • noah48: 10K+ timestamp memories ("User indicates current time is X UTC" stored every 15-30 min)
  • shuiyell: memory store dominated by timestamp entries
  • Pattern: memory_id: 75162ece, 447e817b, 5b0dec36, e7397d95 (all timestamp-only memories)

Fix

One-line addition to the Exclude (NEVER store) section of DEFAULT_CUSTOM_INSTRUCTIONS in config.ts:

- The current date/time as a standalone fact — timestamps are conversation context,
  not durable knowledge. "User indicates current time is 3:25 PM" is NEVER worth
  storing. However, DO use timestamps to anchor other facts: "User installed Ollama
  on 2026-03-21" is correct.

Since the plugin sends custom_instructions in 99.7% of ADD requests, this applies to virtually all OpenClaw traffic without requiring any platform changes.

Test plan

  • Verify extraction LLM stops creating "User indicates current time is..." memories
  • Verify time-anchored facts like "User installed X on YYYY-MM-DD" are still extracted correctly
  • Monitor noah48 / shuiyell memory stores for reduction in timestamp entries after rollout

🤖 Generated with Claude Code

The extraction LLM was storing "User indicates current time is X" as
durable memories every time OpenClaw injected timestamp context into
messages. noah48 alone accumulated 10K+ timestamp memories.

Add explicit exclude rule: timestamps as standalone facts are never
worth storing, but timestamps anchoring real facts ("User installed
Ollama on 2026-03-21") should still be preserved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@whysosaket whysosaket merged commit 669ed18 into main Mar 26, 2026
7 checks passed
@whysosaket whysosaket deleted the fix/openclaw-timestamp-extraction branch March 26, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants