From 44622abfbc83120912060abb1059cbca8a20be83 Mon Sep 17 00:00:00 2001 From: Josh Lehman Date: Mon, 9 Mar 2026 08:04:52 -0700 Subject: [PATCH] test: exercise concurrent context-engine registration --- CHANGELOG.md | 1 + src/context-engine/context-engine.test.ts | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29d4917ed2c..15b57e181ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Docs: https://docs.openclaw.ai - macOS/LaunchAgent install: tighten LaunchAgent directory and plist permissions during install so launchd bootstrap does not fail when the target home path or generated plist inherited group/world-writable modes. - Gateway/Control UI: keep dashboard auth tokens in session-scoped browser storage so same-tab refreshes preserve remote token auth without restoring long-lived localStorage token persistence, while scoping tokens to the selected gateway URL and fragment-only bootstrap flow. (#40892) thanks @velvet-shark. - Models/Kimi Coding: send `anthropic-messages` tools in native Anthropic format again so `kimi-coding` stops degrading tool calls into XML/plain-text pseudo invocations instead of real `tool_use` blocks. (#38669, #39907, #40552) Thanks @opriz. +- Context engine/tests: add bundled-registry regression coverage for cross-chunk resolution, plugin-sdk re-exports, and concurrent chunk registration. (#40460) thanks @dsantoreis. ## 2026.3.8 diff --git a/src/context-engine/context-engine.test.ts b/src/context-engine/context-engine.test.ts index 13e7fe842b6..9b40008f1a0 100644 --- a/src/context-engine/context-engine.test.ts +++ b/src/context-engine/context-engine.test.ts @@ -433,6 +433,10 @@ describe("Bundle chunk isolation (#40096)", () => { it("concurrent registration from multiple chunks does not lose entries", async () => { const ts = Date.now().toString(36); const registryUrl = new URL("./registry.ts", import.meta.url).href; + let releaseRegistrations: (() => void) | undefined; + const registrationStart = new Promise((resolve) => { + releaseRegistrations = resolve; + }); // Load 5 "chunks" in parallel const chunks = await Promise.all( @@ -442,12 +446,14 @@ describe("Bundle chunk isolation (#40096)", () => { ), ); - // Each chunk registers a unique engine - const ids = chunks.map((chunk, i) => { + const ids = chunks.map((_, i) => `concurrent-${ts}-${i}`); + const registrationTasks = chunks.map(async (chunk, i) => { const id = `concurrent-${ts}-${i}`; + await registrationStart; chunk.registerContextEngine(id, () => new MockContextEngine()); - return id; }); + releaseRegistrations?.(); + await Promise.all(registrationTasks); // All 5 engines must be visible from any chunk const allIds = chunks[0].listContextEngineIds();