Skip to content

fix: stabilize Active Memory circuit-breaker tests - #149443

Merged
steipete merged 2 commits into
mainfrom
codex/active-memory-circuit-breaker-fixtures-20260915
Sep 17, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/active-memory-circuit-breaker-fixtures-20260915

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #148951

What Problem This Solves

Active Memory's circuit-breaker test can fail when its supposed successful recall reads a missing transcript beyond the 25 ms deadline. Its cooldown setup also clears failure history before success, so the old case does not independently prove reset after success.

User Impact

No user-visible behavior change. The tests distinguish cooldown recovery from clearing consecutive failures after a successful recall.

Why This Change Was Made

Provide usable memory-tool transcript evidence and assert the returned context. Advance test time after embedded execution starts, join recall cleanup, and remove the unused testing re-export. Simplify equivalent transcript filesystem assertions to stay within the file-size ratchet. The 25 ms test budget and production recovery policy remain unchanged.

Evidence

Validated prepared revision c4226ca3f616e7b091527c50e26c919b2edf9271 on main 91799f175f77371d6cf057d2bce2f211ff0f19a9 in the configured Blacksmith proof run. The wrapper verified the source/tree, completed with exit 0, and stopped its lease normally.

  • Original case passed without injected delay. Delaying only its missing-transcript read reproduced the intended failure: expected 3 embedded calls, got 2, with the 25 ms configuration unchanged.
  • Both new recovery cases passed. Removing only the normal successful-recall reset failed exactly the success case while cooldown passed; restoring it passed both cases again.
  • Full Active Memory index, recall-state, and trigger-recall suites: 252/252 passed.
  • Complete changed checks passed, including 6 Doctor contract tests, both extension typechecks, formatting/lint, file-size and assertion ratchets, plugin boundaries, dead exports, and import cycles.
  • Fresh independent P0–P2 source review is clean. The reviewed patch remained byte-identical after rebasing onto the CI-fixed main.

The first proof attempt failed before test collection because its comparison checkout lacked workspace dependencies; a fresh physical frozen install resolved that setup problem. The earlier file-size CI failure is fixed by the assertion cleanup. Exact published-head CI remains required after publication.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 15, 2026 21:26
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 3:41 AM ET / 07:41 UTC (Revision 4).

ClawSweeper review

What this changes

The PR makes Active Memory recovery tests control elapsed time and verify transcript-backed results, separates cooldown recovery from successful-recall reset, and removes an unused testing re-export.

Merge readiness

✅ Ready for maintainer review

The PR remains useful: current main and the latest release retain the weaker recovery test. No actionable correctness or security findings were identified, and the maintainer-authored work is protected from automatic closure.

Priority: P3
Reviewed head: c4226ca3f616e7b091527c50e26c919b2edf9271

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable test repair with stronger assertions and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor runtime-proof gate does not apply to this maintainer-authored test maintenance PR; its registered-hook tests and reported mutation checks support the changed testing behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor runtime-proof gate does not apply to this maintainer-authored test maintenance PR; its registered-hook tests and reported mutation checks support the changed testing behavior.
Evidence reviewed 8 items Introduced recovery coverage: The two cases invoke the registered prompt-build hook, wait for embedded execution before advancing the unchanged 25 ms budget, and assert returned memory context. The success case inserts a successful recall between two timeouts with a threshold of two, independently exercising failure reset.
Existing production contract: The documentation specifies both successful-recall reset and cooldown recovery. The recall owner resets failures after completed recall, while recall-state owns cooldown expiration; neither production decision changes in this PR.
Current-main necessity: Fetched main retains the original test, which manually expires the breaker before its alleged successful-reset check and returns success payloads without writing usable transcript evidence.
Findings None None.
Security None None.

How this fits together

Active Memory retrieves relevant memories before OpenClaw builds a conversational reply. Its circuit breaker temporarily skips recalls after repeated timeouts, then allows recovery after cooldown or a successful recall.

flowchart TD
  A[Conversation prompt] --> B[Active Memory hook]
  B --> C{Circuit breaker open?}
  C -->|Yes| D[Skip recall]
  C -->|No| E[Memory recall]
  E -->|Timeout| F[Record consecutive failure]
  E -->|Success| G[Clear failures and return context]
  F --> C
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -2, Tests -9. Total -11 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 0 2 -2
Tests 1 67 76 -9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 67 78 -11

Review metrics

None.

Technical review

Best possible solution:

Retain separate hook-level checks for cooldown recovery and successful-recall reset while preserving the existing production timeout and recovery policy.

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

Not applicable to a product defect: this repairs test reliability and coverage. Source confirms the old case conflates the two reset paths; the PR reports a targeted reproduction of its timing failure.

Is this the best way to solve the issue?

Yes. Testing both recovery paths through the registered hook with usable transcript fixtures is narrower and more meaningful than manipulating breaker state or increasing timeouts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0f0939570077.

Labels

Label justifications:

  • P3: This is focused test stabilization with no user-visible runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor runtime-proof gate does not apply to this maintainer-authored test maintenance PR; its registered-hook tests and reported mutation checks support the changed testing behavior.

Evidence

What I checked:

  • Introduced recovery coverage: The two cases invoke the registered prompt-build hook, wait for embedded execution before advancing the unchanged 25 ms budget, and assert returned memory context. The success case inserts a successful recall between two timeouts with a threshold of two, independently exercising failure reset. (extensions/active-memory/index.test.ts:6262, c4226ca3f616)
  • Existing production contract: The documentation specifies both successful-recall reset and cooldown recovery. The recall owner resets failures after completed recall, while recall-state owns cooldown expiration; neither production decision changes in this PR. Public docs: docs/concepts/active-memory/configuration.md. (docs/concepts/active-memory/configuration.md:45, c4226ca3f616)
  • Current-main necessity: Fetched main retains the original test, which manually expires the breaker before its alleged successful-reset check and returns success payloads without writing usable transcript evidence. (extensions/active-memory/index.test.ts, 0f0939570077)
  • Latest-release check: The GitHub contents endpoint confirms that v2026.9.4 still contains the original recovery test. (extensions/active-memory/index.test.ts:6082, 3a9d69db306c)
  • Test-export removal is bounded: Repository-wide references show that remaining getter consumers import directly from recall-state. The removed index re-export is a private testing seam, not a Plugin SDK API change. (extensions/active-memory/index.ts:566, c4226ca3f616)
  • Validation evidence and inspection limits: The captured PR body reports targeted fault injection, a mutation that fails only the successful-reset case, and 252 passing tests at the pinned head. GitHub confirms the linked Testbox run ended cancelled; detailed logs redirect to a host blocked by the reviewer network, so those test results remain contributor-reported rather than independently verified here. No tests were executed during this read-only review; git diff --check passed. (c4226ca3f616)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-15T22:06:20.931Z sha b67af1f :: blocked before merge. :: none
  • reviewed 2026-09-15T22:35:28.487Z sha b67af1f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T06:14:11.333Z sha 9314cd4 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/active-memory-circuit-breaker-fixtures-20260915 branch from b67af1f to 9314cd4 Compare September 17, 2026 06:06
Keep equivalent filesystem assertions within the existing line-cap ratchet while preserving circuit-breaker recovery coverage.
@steipete
steipete force-pushed the codex/active-memory-circuit-breaker-fixtures-20260915 branch from 9314cd4 to c4226ca Compare September 17, 2026 07:33
@steipete
steipete merged commit 1ebfbb5 into main Sep 17, 2026
92 of 93 checks passed
@steipete
steipete deleted the codex/active-memory-circuit-breaker-fixtures-20260915 branch September 17, 2026 14:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
Separate Active Memory circuit-breaker cooldown recovery from success-based reset. Supply usable memory transcript evidence, assert returned context, advance the unchanged 25 ms test deadline deterministically, and join recall cleanup. Remove the unused testing re-export and simplify equivalent filesystem assertions.

Validation: baseline timing failure reproduced; success-reset negative and restoration checks verified; 252 owner/sibling tests and complete changed checks passed. Independent P0-P2 review and exact-head ClawSweeper review found no actionable issues. Published-head CI and its aggregate gate passed.

Refs openclaw#149443, openclaw#148951.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: active-memory maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant