openclaw - 💡(How to fix) Fix Active Memory sub-agent receives all tools instead of toolsAllow filter (toolsAllow not forwarded in runEmbeddedPiAgent) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69892Fetched 2026-04-22 07:46:55
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

Root Cause

Same as #66581 — runEmbeddedPiAgent accepts toolsAllow but does not forward it to runEmbeddedAttemptWithBackend. The sub-agent gets all 60+ tools instead of the restricted 2, causing:

  1. Tool confusion: models pick wrong tools (web_search) or skip tools entirely
  2. Context bloat: full tool schemas inflate the prompt to ~37k tokens
  3. Timeout: large prompts cause slow responses and frequent timeouts

Fix Action

Workaround

None effective. The bug is in the core runner, not in plugin config. Setting persistTranscripts: true helps with diagnosis but does not fix the tool injection.

RAW_BUFFERClick to expand / collapse

Bug Description

Active Memory sub-agent is supposed to only have access to memory_search and memory_get (via toolsAllow), but the toolsAllow parameter is not forwarded through runEmbeddedPiAgentrunEmbeddedAttemptWithBackend. As a result, the sub-agent receives all configured tools and never calls the restricted memory tools.

Reproduction

Environment

  • OpenClaw version: 2026.4.20
  • Active Memory plugin: enabled, queryMode: "recent", promptStyle: "recall-heavy"
  • Models tested: glm-5.1, grok-4.20-fast (via proxy providers)

Steps

  1. Configure active-memory plugin with any model
  2. Ask a question that should trigger memory recall (e.g., "what is my favorite singer")
  3. Enable persistTranscripts: true for debugging

Observed Behavior

With glm-5.1:

  • Sub-agent receives all tools, ignores memory_search
  • Fabricates answer without calling any tool: "User's favorite singer is 周杰伦."
  • Answer is incorrect (fabricated)

With grok-4.20-fast:

  • Sub-agent receives all tools, ignores memory_search
  • Attempts to use web_search instead (wrong tool)
  • Returns NONE

Neither model calls memory_search or memory_get, despite the plugin explicitly setting toolsAllow: ["memory_search", "memory_get"].

Transcript Evidence

The sub-agent transcript shows:

  • No memory_search or memory_get tool calls
  • Model thinking includes references to web_search or direct fabrication
  • Only a user message → assistant text response (no tool invocation)

Root Cause

Same as #66581 — runEmbeddedPiAgent accepts toolsAllow but does not forward it to runEmbeddedAttemptWithBackend. The sub-agent gets all 60+ tools instead of the restricted 2, causing:

  1. Tool confusion: models pick wrong tools (web_search) or skip tools entirely
  2. Context bloat: full tool schemas inflate the prompt to ~37k tokens
  3. Timeout: large prompts cause slow responses and frequent timeouts

Related Issues

  • #66581 — Original report of this exact bug (toolsAllow not forwarded)
  • #65998 — MCP tool schemas bypass toolsAllow filter
  • #66157 — Active-memory timeout with queryMode="message" (likely caused by this bug)

Workaround

None effective. The bug is in the core runner, not in plugin config. Setting persistTranscripts: true helps with diagnosis but does not fix the tool injection.

extent analysis

TL;DR

The most likely fix is to modify the runEmbeddedPiAgent function to forward the toolsAllow parameter to runEmbeddedAttemptWithBackend, ensuring the sub-agent only receives the restricted tools.

Guidance

  • Review the runEmbeddedPiAgent function to confirm it does not forward toolsAllow to runEmbeddedAttemptWithBackend.
  • Modify the runEmbeddedPiAgent function to pass toolsAllow to runEmbeddedAttemptWithBackend, restricting the tools available to the sub-agent.
  • Verify the fix by checking the sub-agent transcript for memory_search or memory_get tool calls after applying the change.
  • Test the modified function with different models and query modes to ensure the fix does not introduce new issues.

Example

def runEmbeddedPiAgent(..., toolsAllow):
    # ...
    return runEmbeddedAttemptWithBackend(..., toolsAllow=toolsAllow)

Notes

The provided workaround is not effective, as the bug is in the core runner. The fix requires modifying the runEmbeddedPiAgent function to forward the toolsAllow parameter.

Recommendation

Apply the workaround by modifying the runEmbeddedPiAgent function to forward the toolsAllow parameter, as this directly addresses the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING