Skip to content

OpenClaw plugin: Fix broken auto-recall memory injection#4038

Closed
Zlo7 wants to merge 1 commit intomem0ai:mainfrom
jamesjmartin:fix/openclaw-recall-injection
Closed

OpenClaw plugin: Fix broken auto-recall memory injection#4038
Zlo7 wants to merge 1 commit intomem0ai:mainfrom
jamesjmartin:fix/openclaw-recall-injection

Conversation

@Zlo7
Copy link
Copy Markdown
Contributor

@Zlo7 Zlo7 commented Feb 12, 2026

Change systemContext to prependContext in before_agent_start hook to match OpenClaw's expected property name. Memories were being fetched but never injected into prompts.

Description

Fixes a critical bug where auto-recall memory injection was silently broken. The before_agent_start hook returned { systemContext: ... } but OpenClaw's hook runner only checks for { prependContext: ... }. This caused memories to be fetched and logged but never actually injected into conversation prompts.

Root Cause: Property name mismatch in hook return object
Impact: Auto-recall appears to work (logs show injection) but memories never reach the LLM
Fix: One-line property rename from systemContext to prependContext

Fixes #4037

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual testing steps performed:

  • Set OPENCLAW_CACHE_TRACE and OPENCLAW_ANTHROPIC_PAYLOAD_LOG to true
  • Enabled auto-recall in mem0 OpenClaw plugin
  • Restarted openclaw gateway
  • Started conversation triggering memory recall
  • Verified now appear in .openclaw/logs
  • Verified system prompt (agent.md, soul.md) remains unaffected

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Change systemContext to prependContext in before_agent_start hook to match OpenClaw's expected property name. Memories were being fetched but never injected into prompts.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 12, 2026

CLA assistant check
All committers have signed the CLA.

@Utkarsh07
Copy link
Copy Markdown

Overlapping PR. Change already merged in #4065. We can close this.

@jamesjmartin jamesjmartin deleted the fix/openclaw-recall-injection branch March 9, 2026 12:06
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.

OpenClaw plugin auto-recall memory injection silently broken due to incorrect property name

5 participants