Repository navigation
fix(plugins): memory background reload tests time out on plugin changes - #180826
fuller-stack-dev merged 1 commit into
Conversation
openclaw#178979 moved watch notifications, session startup catch-up and session deltas from Memory Core's public sync() to its background sync owner so indexing can yield to foreground turns and resume. Memory Core's own tests were updated, but src/plugins/memory-background-reload.test.ts still waited for sync() calls that no longer happen, so three cases timed out after 120 s. Observe the background sync owner instead, keeping every outcome assertion. The reload-deadline case also passed only when an earlier case had already marked the main agent's index live in this process. A cold service start leaves untouched indexes closed, so open the index before waiting for its first watcher.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR observes Memory Core’s background sync owner and opens the test index before waiting for its watcher. Example: Run src/plugins/memory-background-reload.test.ts independently.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR repairs stale integration-test synchronization while preserving indexing and lifecycle assertions; no actionable defect was found, and the exact-head CI gate now passes. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe integration suite loads the real Memory Core plugin through the plugin registry, triggers watcher and session work across reloads, and checks indexed chunks, provider generation, detached context, and resource retirement. flowchart LR
A[Integration fixture] --> B[Plugin registry and lifecycle]
B --> C[Memory Core manager]
D[Watch and session events] --> C
C --> E[Background sync owner]
E --> F[Indexed chunks and embeddings]
F --> G[Outcome assertions]
Technical reviewBest possible solution: Merge the focused test repair while retaining the existing production background-sync and lazy-startup owners. Do we have a high-confidence way to reproduce the issue? Source confirms that the baseline waits for public sync calls bypassed by background scheduling and awaits a watcher before opening its cold index; the PR records matching baseline failures, but this read-only review ran no tests. Is this the best way to solve the issue? The patch updates the existing observation boundary and fixture ordering without changing production behavior, increasing timeouts, skipping cases, or weakening outcome assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e1f4e11918cd. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +14. Total +14 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 1:42 PM ET / 17:42 UTC. |
…180826) openclaw#178979 moved watch notifications, session startup catch-up and session deltas from Memory Core's public sync() to its background sync owner so indexing can yield to foreground turns and resume. Memory Core's own tests were updated, but src/plugins/memory-background-reload.test.ts still waited for sync() calls that no longer happen, so three cases timed out after 120 s. Observe the background sync owner instead, keeping every outcome assertion. The reload-deadline case also passed only when an earlier case had already marked the main agent's index live in this process. A cold service start leaves untouched indexes closed, so open the index before waiting for its first watcher.
What Problem This Solves
Fixes:
src/plugins/memory-background-reload.test.tsruns into four 120 s timeouts whenever CI selects it. That turnsopenclaw/ci-gatered on every PR that touchessrc/plugins/**. #180079, #179526 and #180173 hit it, and the failure reproduces on cleanmain.User Impact
No user-visible change. Plugin PRs get a meaningful
ci-gateresult again. The file now finishes in about a minute instead of hanging for eight.Why This Change Was Made
#178979 (thanks @steipete) changed how Memory Core starts indexing. Watch notifications, session startup catch-up and session-delta indexing used to go through the public
sync(). They now go through Memory Core's background sync owner, so indexing can yield to foreground turns and resume.sync()calls with those reasons. Those calls no longer happen, so three cases waited until the 120 s timeout.There are no production changes. No timeout is raised and nothing is skipped.
Evidence
Local runs used Node 24.22.1 with an isolated HOME, TMPDIR and state.
1bd44907with the original test:aa52e91b.pnpm test src/plugins/memory-background-reload.test.ts --maxWorkers=1: 5/5 passed, about 12 s of test time and 70 s wall (mostly import and transform).--sequence.shuffle --sequence.seed=17).pnpm test extensions/memory-core packages/memory-host-sdk: 5 shards, 231 files passed and 8 skipped (2,302 tests passed, 56 skipped).pnpm test src/plugins: 586 files passed. The only failure is the unrelatedbundled-plugin-icons.test.ts:extensions/autoreview/assets/icon.pngis missing onmain, and this PR changes no extension.plugins-platformgraph reports nothing in this file. A deliberate type error placed in the file was caught. The only remaining diagnostic is inpackages/ai/src/transports/openai-responses-websocket.ts, which this PR doesn't touch and which reports the same error on main.Cost: this is an existing integration file that loads the real Memory Core plugin; it now takes about 12 s of test time instead of eight minutes of timeouts.
Not covered: I didn't run a live Gateway. The change is test-only, and the production paths it observes are unchanged.