Skip to content

fix(plugins): memory background reload tests time out on plugin changes - #180826

Merged
fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:fix/memory-background-reload-tests
Oct 22, 2026
Merged

fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:fix/memory-background-reload-tests

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: src/plugins/memory-background-reload.test.ts runs into four 120 s timeouts whenever CI selects it. That turns openclaw/ci-gate red on every PR that touches src/plugins/**. #180079, #179526 and #180173 hit it, and the failure reproduces on clean main.

User Impact

No user-visible change. Plugin PRs get a meaningful ci-gate result 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.

  • Root cause: that PR updated Memory Core's own tests to observe the new path, but this core-side test still waited for sync() calls with those reasons. Those calls no longer happen, so three cases waited until the 120 s timeout.
  • The product works: the cases now observe the background sync owner, and every existing outcome assertion passes unchanged. Those assertions cover successor indexing with stored chunks, embeddings from the replacement provider outside turn and request context, and retired watchers staying quiet.
  • Fourth case: "reload waits for active indexing past its stop deadline" passed only if an earlier case had already marked the main agent's index live in the same process. A cold service start restores only indexes that were already used (fix(gateway): restore 2026.10.4 startup memory by keeping cold start from opening every memory index #174718/feat: open new agent chats instantly and simplify agent selection #175291), so the case waited forever for a watcher whenever it ran alone. It now opens the index first and then waits for its first watcher, which matches first use in production. After the earlier cases hung, it also failed in CI.

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.

  • Before, at base 1bd44907 with the original test:
    • Full file: 4 failed (120 s each), 1 passed, 518 s.
    • Reload-deadline case alone: failed (120 s), and failed again on 3 earlier runs at aa52e91b.
    • The same four failures appear in CI on #180173.
  • After, at this head:
    • 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).
    • Each case passes on its own.
    • The file passes in shuffled order (--sequence.shuffle --sequence.seed=17).
    • It also passed on 2 more full runs.
  • Mutation check: I made background sync skip watch and session work. Cases 1 and 4 then fail within seconds with assertion errors, not timeouts. So the new observation still catches lost background indexing.
  • Affected suites at this head:
    • 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 unrelated bundled-plugin-icons.test.ts: extensions/autoreview/assets/icon.png is missing on main, and this PR changes no extension.
  • Type check: the plugins-platform graph reports nothing in this file. A deliberate type error placed in the file was caught. The only remaining diagnostic is in packages/ai/src/transports/openai-responses-websocket.ts, which this PR doesn't touch and which reports the same error on main.
  • Other checks: lint and format are clean, and the local auto review found nothing to fix.

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.

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.
@clawsweeper

clawsweeper Bot commented Oct 22, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The reported baseline has four 120-second timeouts from obsolete sync observers and an unopened index.
  • After: The reported candidate passes all five cases, including independent and shuffled runs.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct test repair supported by source, reported integration runs, and green exact-head CI; evidence is confined to an in-process test harness.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only repair changes no shipped behavior; reported real-plugin integration runs cover baseline failure, candidate success, isolated and shuffled cases, and a background-indexing mutation control.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Plugin contributors receive failing CI results because the reload integration suite waits for obsolete synchronization signals.
Reason: This maintainer-authored repair restores distinct reload regressions and preserves the existing product contracts.

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
Reviewed head: a6585713947591d7243aa55629b7913615a4d99c

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e69e340 adds src/plugins/memory-background-reload.test.ts:322 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e69e34001fb5; files: src/plugins/memory-background-reload.test.ts)

PR surface

Tests +14. Total +14 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 34 20 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 34 20 +14

Labels

Label changes:

  • add P2: The repair restores useful plugin CI coverage without changing shipped runtime behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The repair restores useful plugin CI coverage without changing shipped runtime behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 22, 2026, 1:42 PM ET / 17:42 UTC.

@fuller-stack-dev
fuller-stack-dev merged commit c133b02 into openclaw:main Oct 22, 2026
119 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/memory-background-reload-tests branch October 22, 2026 17:46
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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