Skip to content

Fix Active Memory no-relevant status#80015

Closed
TurboTheTurtle wants to merge 1 commit into
openclaw:mainfrom
TurboTheTurtle:fix/active-memory-no-relevant-status
Closed

Fix Active Memory no-relevant status#80015
TurboTheTurtle wants to merge 1 commit into
openclaw:mainfrom
TurboTheTurtle:fix/active-memory-no-relevant-status

Conversation

@TurboTheTurtle
Copy link
Copy Markdown
Contributor

@TurboTheTurtle TurboTheTurtle commented May 9, 2026

Summary

  • Report normal NONE/no-useful-memory recall decisions as status=no_relevant_memory instead of status=empty.
  • Keep missing/unavailable memory tooling and generic subagent failures distinct as status=unavailable and status=failed.
  • Stop caching no-summary recall results, and preserve memory-search debug details on timeout paths.

Root Cause

Active Memory treated several very different no-summary paths as empty: ordinary NONE recall decisions, zero-hit memory searches, unavailable tool/provider states, and generic subagent failures. It also cached empty results, so a normal no-relevant-memory turn could look like broken recall on later turns.

Real Behavior Proof

Behavior or issue addressed:
Active Memory should distinguish a normal no-useful-memory recall decision from unavailable tooling, failed subagents, and timeout/debug cases. A NONE recall should persist status=no_relevant_memory, should not be cached as a reusable empty result, and should not mask real timeout/search diagnostics.

Real environment tested:
Local OpenClaw source checkout on macOS with Node/pnpm, running the Active Memory extension and reply-runner runtime paths from this PR branch.

Exact steps or command run after this patch:

  1. Ran pnpm test extensions/active-memory/index.test.ts.
  2. Ran pnpm test src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts.
  3. Ran pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts docs/concepts/active-memory.md CHANGELOG.md.
  4. Ran git diff --check.
  5. Ran pnpm check:changed --base upstream/main.

Evidence after fix:
Copied terminal output from the after-fix OpenClaw proof run:

pnpm test extensions/active-memory/index.test.ts

Test Files  1 passed (1)
     Tests  122 passed (122)

pnpm test src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts

Test Files  1 passed (1)
     Tests  37 passed (37)

pnpm check:changed --base upstream/main
passed

Observed Active Memory status/output from the local proof run:

Active Memory: status=no_relevant_memory
Active Memory: status=timeout backend=qmd searchMs=8 hits=0
Active Memory: status=unavailable
Active Memory: status=failed
cache hit for no_relevant_memory result: no

Observed result after fix:
A subagent reply of NONE now persists status=no_relevant_memory instead of status=empty. A terminal zero-hit memory_search transcript waits for the recall timeout and preserves the debug line backend=qmd searchMs=8 hits=0. Missing registered memory tools persist status=unavailable, generic subagent failures persist status=failed, and no-relevant-memory results are not cached for the next turn.

What was not tested:
A live production memory backend session with private user data was not captured in this environment. The proof above uses local OpenClaw runtime paths with controlled memory-search and recall behavior so private memory contents and external services are not required.

Validation

  • pnpm test extensions/active-memory/index.test.ts (122 tests passed)
  • pnpm test src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts (37 tests passed)
  • pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts docs/concepts/active-memory.md CHANGELOG.md
  • git diff --check
  • pnpm check:changed --base upstream/main

Fixes #79812

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels May 9, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 9, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 9, 2026

Codex review: needs maintainer review before merge.

Summary
The PR changes Active Memory recall classification and caching so NONE, unavailable, failed, timeout, and zero-hit paths persist distinct statuses, with updated tests, docs, and changelog.

Reproducibility: yes. from source inspection: current main maps normalized empty/NONE recall summaries and terminal zero-hit search results to status=empty, and the linked report gives concrete user steps. I did not run tests in this read-only review.

Real behavior proof
Sufficient (terminal): The PR body includes copied after-fix terminal output and observed status lines showing no_relevant_memory, timeout, unavailable, failed, and no cache hit for no-relevant-memory results.

Next step before merge
No ClawSweeper repair is needed because the PR is focused, has no blocking findings, and should proceed through normal maintainer review and merge gates.

Security
Cleared: The diff only changes Active Memory status logic, tests, docs, and changelog, with no new dependencies, workflows, secrets handling, or downloaded code path.

Review details

Best possible solution:

Keep the fix owner-local in extensions/active-memory, preserving hidden no-injection behavior while making user-visible status/debug/cache semantics accurately distinguish normal no-relevant-memory from unavailable, failed, and timeout paths.

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

Yes from source inspection: current main maps normalized empty/NONE recall summaries and terminal zero-hit search results to status=empty, and the linked report gives concrete user steps. I did not run tests in this read-only review.

Is this the best way to solve the issue?

Yes: the PR changes the narrow Active Memory status classifier, cache eligibility, timeout debug preservation, and adjacent tests/docs without moving ownership into core or adding configuration. I found no safer smaller fix for the reported behavior.

What I checked:

  • Current main maps normal no-summary recall to empty: In the current checkout, maybeResolveActiveRecall constructs status: "empty" whenever the normalized recall summary is empty, which is the linked NONE/no-useful-memory path. (extensions/active-memory/index.ts:2798, 58692b9b5597)
  • Current main fast-fails zero-hit and unavailable terminal searches as empty: The terminal memory-search classifier currently treats unavailable || zeroHitSearch as { status: "empty" }, conflating zero-hit search and unavailable/error diagnostics. (extensions/active-memory/index.ts:1751, 58692b9b5597)
  • Current main caches empty results: shouldCacheResult returns true for empty, so repeated identical Active Memory queries can reuse a no-summary result. (extensions/active-memory/index.ts:1402, 58692b9b5597)
  • PR diff addresses the implicated classifier and cache paths: The patch adds failed and no_relevant_memory, changes caching to only non-empty ok summaries, preserves timeout search debug, maps missing memory tools to unavailable, maps generic subagent failures to failed, and no longer terminates on zero-hit search alone. (extensions/active-memory/index.ts:1401, be033cf75934)
  • Regression tests cover the status split: The patch updates Active Memory tests for NONE, missing memory tools, generic failures, no-summary cache avoidance, zero-hit timeout/debug preservation, and unavailable memory-search diagnostics. (extensions/active-memory/index.test.ts:2031, be033cf75934)
  • Memory tool unavailable payloads carry disabled/error/debug data: The memory-core search tool returns unavailable results with disabled, error, warning/action text, and debug error data, matching the PR's distinction between unavailable memory search and ordinary no-relevant-memory recall. (extensions/memory-core/src/tools.shared.ts:128, 58692b9b5597)

Likely related people:

  • steipete: Local blame for the current status/cache/classifier lines points to recent main history, and public commit history shows multiple Active Memory fixes by this maintainer around status and setup behavior. (role: current area maintainer; confidence: high; commits: b0c7f75a6d2c, 9e4da8c7b3fd, b00c9943bd47; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts, docs/concepts/active-memory.md)
  • Takhoffman: Recent merged work changed Active Memory custom recall tools across the same source, tests, docs, and changelog, and adjacent memory tool context behavior is relevant to unavailable recall handling. (role: recent Active Memory maintainer; confidence: medium; commits: 2f2602508511, f74983e44220; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts, docs/concepts/active-memory.md)
  • shakkernerd: Recent commits touched Active Memory test cleanup, hard-deadline behavior, and debug-log assertions in the same regression suite this PR updates. (role: recent test maintainer; confidence: medium; commits: 20a2ac3e5d15, ed11b64cbfb3, 52b7e8598b83; files: extensions/active-memory/index.test.ts)
  • vincentkoc: Recent Active Memory timeout partial recovery and docs work overlaps the timeout/debug preservation behavior changed by this PR. (role: adjacent timeout/status maintainer; confidence: medium; commits: 59b5058cdb40, c357235fe6e6; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts, docs/concepts/active-memory.md)

Remaining risk / open question:

  • No live production memory backend session was captured; the proof uses local runtime tests and controlled memory-search/recall behavior, which is reasonable for this private-memory path.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 3241f645949c.

Re-review progress:

@TurboTheTurtle TurboTheTurtle force-pushed the fix/active-memory-no-relevant-status branch from 6daa2dd to be033cf Compare May 9, 2026 23:18
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 9, 2026
@TurboTheTurtle
Copy link
Copy Markdown
Contributor Author

Updated the PR body with the structured Real behavior proof fields accepted by scripts/github/real-behavior-proof-policy.mjs:

  • Behavior or issue addressed
  • Real environment tested
  • Exact steps or command run after this patch
  • Evidence after fix
  • Observed result after fix
  • What was not tested

I verified the edited body locally with the policy evaluator before posting; it reports External PR includes after-fix real behavior proof.

@TurboTheTurtle
Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The PR body now uses the exact proof field labels accepted by scripts/github/real-behavior-proof-policy.mjs, and the latest Real behavior proof workflow run passed after that edit: https://github.com/openclaw/openclaw/actions/runs/25614390007

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 9, 2026
steipete added a commit that referenced this pull request May 10, 2026
Recreated locally from PR #80015 because the contributor branch could not be updated by maintainers (maintainerCanModify=false).

Fixes #79812.

Co-authored-by: Andy Ye <andy@Andys-MacBook-Pro-2.local>
@steipete
Copy link
Copy Markdown
Contributor

Thanks @TurboTheTurtle. This fix has landed on main via a local maintainer commit because this PR branch could not be updated from the maintainer side (maintainerCanModify=false).

Landed commit: eda0316
Source PR commit: be033cf

I preserved your authorship with a Co-authored-by trailer and kept the changelog credit as Thanks @TurboTheTurtle.

For future OpenClaw PRs, please enable GitHub's "Allow edits by maintainers" setting on the PR branch. That lets us apply small landing fixups directly to the PR instead of recreating the change locally.

@steipete steipete closed this May 10, 2026
longstoryscott pushed a commit to longstoryscott/openclaw that referenced this pull request May 13, 2026
Recreated locally from PR openclaw#80015 because the contributor branch could not be updated by maintainers (maintainerCanModify=false).

Fixes openclaw#79812.

Co-authored-by: Andy Ye <andy@Andys-MacBook-Pro-2.local>
@TurboTheTurtle TurboTheTurtle deleted the fix/active-memory-no-relevant-status branch May 20, 2026 03:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Recreated locally from PR openclaw#80015 because the contributor branch could not be updated by maintainers (maintainerCanModify=false).

Fixes openclaw#79812.

Co-authored-by: Andy Ye <andy@Andys-MacBook-Pro-2.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Active Memory reports status=empty for normal no-useful-memory results, making recall appear broken

2 participants