Skip to content

fix(active-memory): skip sub-agent gracefully when no memory tools registered (#77506)#77515

Merged
Takhoffman merged 4 commits into
openclaw:mainfrom
hclsys:fix/77506-active-memory-remove-stale-memory-recall-from-toolsallow
May 4, 2026
Merged

fix(active-memory): skip sub-agent gracefully when no memory tools registered (#77506)#77515
Takhoffman merged 4 commits into
openclaw:mainfrom
hclsys:fix/77506-active-memory-remove-stale-memory-recall-from-toolsallow

Conversation

@hclsys

@hclsys hclsys commented May 4, 2026

Copy link
Copy Markdown

Fixes #77506.

When active-memory is enabled but no memory plugin is loaded (memory-core or memory-lancedb), the embedded memory sub-agent attempts to run with toolsAllow: ["memory_recall", "memory_search", "memory_get"]. If none of those tools are registered, the tool-allowlist guard throws:

No callable tools remain after resolving explicit tool allowlist (runtime toolsAllow: memory_recall, memory_search, memory_get); no registered tools matched.

This error is caught by the outer before_prompt_build hook and logged as a confusing warning. The user's reported session wipe is likely a separate issue, but the allowlist error is real noise.

Fix

In runActiveMemorySubAgent's catch block, detect the "No callable tools remain" error from the tool-allowlist guard and return { rawReply: "NONE" } — the same empty result the sub-agent returns when it finds no relevant memories — instead of rethrowing. This silences the confusing error and lets the gateway log stay clean.

No behavior change when memory plugins are loaded:

  • memory-core registered → memory_search + memory_get callable → sub-agent runs normally
  • memory-lancedb registered → all three callable → sub-agent uses memory_recall when appropriate (as the system prompt already instructs)

Changes

  • extensions/active-memory/index.ts: catch the "No callable tools remain" error and return empty result with a debug-level log
  • CHANGELOG.md: entry under Fixes

Test

pnpm vitest run extensions/active-memory/index.test.ts
# 104/104 pass

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper review

@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR makes active-memory return an empty recall result when the embedded memory sub-agent hits the missing registered memory-tools allowlist error, adds regression coverage, and adds a changelog entry.

Reproducibility: yes. Source inspection shows current main can route active-memory's runtime memory tool allowlist into the embedded runner with no registered memory tools, and the linked issue provides the concrete gateway error shape.

Next step before merge
A maintainer explicitly stopped ClawSweeper automation after the branch repair, so the remaining action is human review and merge judgment rather than another automated repair.

Security
Cleared: The diff only changes active-memory error handling, active-memory tests, and CHANGELOG.md; it does not alter dependencies, workflows, secrets, packaging, or code-loading surfaces.

Review details

Best possible solution:

Have a maintainer review and merge the current PR once exact-head CI is fully green, keeping the fix local to active-memory and leaving memory tool ownership in the memory plugins.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows current main can route active-memory's runtime memory tool allowlist into the embedded runner with no registered memory tools, and the linked issue provides the concrete gateway error shape.

Is this the best way to solve the issue?

Yes. Returning the normal empty recall result for only the missing registered memory-tools guard error is the narrow maintainable fix, and the current PR head preserves tools-disabled, unsupported-model, and abort diagnostics.

What I checked:

  • PR catch predicate: PR head f383456 adds isMissingRegisteredMemoryToolsError, matching the shared guard prefix, the runtime memory allowlist, the no registered tools matched reason, and the guard suffix before returning { rawReply: "NONE" } when the run was not aborted. (extensions/active-memory/index.ts:495, f383456c9a2f)
  • PR regression tests: The PR adds tests for the runtime-only missing-tools error, inherited allowlist sources like tools.allow: *, lobster, non-swallowed tools-disabled/model-without-tools errors, and the abort path. (extensions/active-memory/index.test.ts:1663, f383456c9a2f)
  • Current main active-memory path: Current main passes toolsAllow: ["memory_recall", "memory_search", "memory_get"] into the embedded recall runner and currently rethrows runner errors from runRecallSubagent. (extensions/active-memory/index.ts:2397, 5005f5b22e10)
  • Allowlist guard shape: The embedded runner collects inherited config and runtime allowlist sources, while the shared guard formats all explicit sources before appending no registered tools matched, matching the linked report's multi-source error shape. (src/agents/pi-embedded-runner/run/attempt.ts:680, 5005f5b22e10)
  • Memory tool registration: memory-core registers memory_search and memory_get, while memory-lancedb registers memory_recall, so the skip should apply only when no memory plugin contributes any of these tools. (extensions/memory-core/index.ts:190, 5005f5b22e10)
  • Related issue evidence: The linked issue reports the exact multi-source allowlist failure with active-memory enabled and no memory backend, including tools.allow: *, lobster; runtime toolsAllow: memory_recall, memory_search, memory_get; no registered tools matched.

Likely related people:

  • hclsys: Recent merged active-memory crash work touched the same plugin/test/changelog surface, and this PR also starts from that contributor's active-memory fix branch. (role: recent active-memory maintainer; confidence: high; commits: dff437a1cbe7, 0cf6694317af; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts, CHANGELOG.md)
  • SYU8384: Same-day Active Memory memory-only recall work changed the central recall implementation shortly before this PR. (role: recent adjacent owner; confidence: medium; commits: f2efe33afc5d; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts, CHANGELOG.md)
  • vincentkoc: Recent active-memory timeout and partial recovery work touched the same recall error-handling area on current main. (role: recent active-memory maintainer; confidence: medium; commits: 59b5058cdb40; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts)
  • Brad: Recent history on the embedded runner attempt path touches the code that collects explicit allowlist sources before the shared guard builds the error. (role: embedded-runner adjacent maintainer; confidence: low; commits: be8b4dc84514; files: src/agents/pi-embedded-runner/run/attempt.ts)

Remaining risk / open question:

  • One exact-head CI check was still in progress during this read-only pass, although no completed check had failed.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 5005f5b22e10.

@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@Takhoffman Takhoffman self-assigned this May 4, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 4, 2026
@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🦞🔧
ClawSweeper picked up the repair feedback.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper marker: fix-required (finding=review-feedback sha=e6ea291280bc4c5d95300a93953c36f0ff711109)
Action: repair worker queued. Run: https://api.github.com/repos/openclaw/clawsweeper/actions/runs/25342459909
Model: gpt-5.5

I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow fix.

Automerge progress:

  • 2026-05-04 20:48:00 UTC review queued fa779e234c73 (queued)
  • 2026-05-04 20:54:54 UTC review requested repair fa779e234c73 (structured ClawSweeper marker: fix-required (finding=review-feedback sha=fa779e...)
  • 2026-05-04 20:58:37 UTC review queued e6ea291280bc (after repair)
  • 2026-05-04 21:05:25 UTC review requested repair e6ea291280bc (structured ClawSweeper marker: fix-required (finding=review-feedback sha=e6ea29...)

@clawsweeper
clawsweeper Bot force-pushed the fix/77506-active-memory-remove-stale-memory-recall-from-toolsallow branch from fa779e2 to e6ea291 Compare May 4, 2026 20:58
HCL and others added 2 commits May 4, 2026 16:29
…gistered (openclaw#77506)

When memory-core and memory-lancedb are both absent, the embedded
memory sub-agent would throw 'No callable tools remain after resolving
explicit tool allowlist', which propagated as a noisy warning through
the before_prompt_build hook. Catch this specific error in
runActiveMemorySubAgent and return an empty NONE result so the
gateway log stays clean and the sub-agent run is skipped without
disrupting the parent session.
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper stop

@clawsweeper clawsweeper Bot added clawsweeper:human-review Needs maintainer review before ClawSweeper can continue and removed clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge labels May 4, 2026
@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🦞✅
Got it. ClawSweeper will leave this item for human review.

I added clawsweeper:human-review, removed clawsweeper:automerge, and paused the automation trail until a maintainer asks again.

@Takhoffman
Takhoffman force-pushed the fix/77506-active-memory-remove-stale-memory-recall-from-toolsallow branch from e6ea291 to f383456 Compare May 4, 2026 21:33
@Takhoffman
Takhoffman merged commit d0cae0d into openclaw:main May 4, 2026
86 checks passed
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
…gistered (openclaw#77506) (openclaw#77515)

* fix(active-memory): skip sub-agent gracefully when no memory tools registered (openclaw#77506)

When memory-core and memory-lancedb are both absent, the embedded
memory sub-agent would throw 'No callable tools remain after resolving
explicit tool allowlist', which propagated as a noisy warning through
the before_prompt_build hook. Catch this specific error in
runActiveMemorySubAgent and return an empty NONE result so the
gateway log stays clean and the sub-agent run is skipped without
disrupting the parent session.

* fix(active-memory): skip missing memory-tool subagent runs

* fix(active-memory): match inherited missing memory tool errors

* fix(active-memory): preserve policy-filtered memory errors

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: Tak Hoffman <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…gistered (openclaw#77506) (openclaw#77515)

* fix(active-memory): skip sub-agent gracefully when no memory tools registered (openclaw#77506)

When memory-core and memory-lancedb are both absent, the embedded
memory sub-agent would throw 'No callable tools remain after resolving
explicit tool allowlist', which propagated as a noisy warning through
the before_prompt_build hook. Catch this specific error in
runActiveMemorySubAgent and return an empty NONE result so the
gateway log stays clean and the sub-agent run is skipped without
disrupting the parent session.

* fix(active-memory): skip missing memory-tool subagent runs

* fix(active-memory): match inherited missing memory tool errors

* fix(active-memory): preserve policy-filtered memory errors

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: Tak Hoffman <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…gistered (openclaw#77506) (openclaw#77515)

* fix(active-memory): skip sub-agent gracefully when no memory tools registered (openclaw#77506)

When memory-core and memory-lancedb are both absent, the embedded
memory sub-agent would throw 'No callable tools remain after resolving
explicit tool allowlist', which propagated as a noisy warning through
the before_prompt_build hook. Catch this specific error in
runActiveMemorySubAgent and return an empty NONE result so the
gateway log stays clean and the sub-agent run is skipped without
disrupting the parent session.

* fix(active-memory): skip missing memory-tool subagent runs

* fix(active-memory): match inherited missing memory tool errors

* fix(active-memory): preserve policy-filtered memory errors

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: Tak Hoffman <[email protected]>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…gistered (openclaw#77506) (openclaw#77515)

* fix(active-memory): skip sub-agent gracefully when no memory tools registered (openclaw#77506)

When memory-core and memory-lancedb are both absent, the embedded
memory sub-agent would throw 'No callable tools remain after resolving
explicit tool allowlist', which propagated as a noisy warning through
the before_prompt_build hook. Catch this specific error in
runActiveMemorySubAgent and return an empty NONE result so the
gateway log stays clean and the sub-agent run is skipped without
disrupting the parent session.

* fix(active-memory): skip missing memory-tool subagent runs

* fix(active-memory): match inherited missing memory tool errors

* fix(active-memory): preserve policy-filtered memory errors

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: Tak Hoffman <[email protected]>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…gistered (openclaw#77506) (openclaw#77515)

* fix(active-memory): skip sub-agent gracefully when no memory tools registered (openclaw#77506)

When memory-core and memory-lancedb are both absent, the embedded
memory sub-agent would throw 'No callable tools remain after resolving
explicit tool allowlist', which propagated as a noisy warning through
the before_prompt_build hook. Catch this specific error in
runActiveMemorySubAgent and return an empty NONE result so the
gateway log stays clean and the sub-agent run is skipped without
disrupting the parent session.

* fix(active-memory): skip missing memory-tool subagent runs

* fix(active-memory): match inherited missing memory tool errors

* fix(active-memory): preserve policy-filtered memory errors

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: Tak Hoffman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:human-review Needs maintainer review before ClawSweeper can continue size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: active-memory toolsAllow references memory_recall but no plugin registers it — causes session wipe

2 participants