Skip to content

Commit 44622ab

Browse files
committed
test: exercise concurrent context-engine registration
1 parent 5dc232e commit 44622ab

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Docs: https://docs.openclaw.ai
1313
- 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.
1414
- 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.
1515
- 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.
16+
- Context engine/tests: add bundled-registry regression coverage for cross-chunk resolution, plugin-sdk re-exports, and concurrent chunk registration. (#40460) thanks @dsantoreis.
1617

1718
## 2026.3.8
1819

src/context-engine/context-engine.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ describe("Bundle chunk isolation (#40096)", () => {
433433
it("concurrent registration from multiple chunks does not lose entries", async () => {
434434
const ts = Date.now().toString(36);
435435
const registryUrl = new URL("./registry.ts", import.meta.url).href;
436+
let releaseRegistrations: (() => void) | undefined;
437+
const registrationStart = new Promise<void>((resolve) => {
438+
releaseRegistrations = resolve;
439+
});
436440

437441
// Load 5 "chunks" in parallel
438442
const chunks = await Promise.all(
@@ -442,12 +446,14 @@ describe("Bundle chunk isolation (#40096)", () => {
442446
),
443447
);
444448

445-
// Each chunk registers a unique engine
446-
const ids = chunks.map((chunk, i) => {
449+
const ids = chunks.map((_, i) => `concurrent-${ts}-${i}`);
450+
const registrationTasks = chunks.map(async (chunk, i) => {
447451
const id = `concurrent-${ts}-${i}`;
452+
await registrationStart;
448453
chunk.registerContextEngine(id, () => new MockContextEngine());
449-
return id;
450454
});
455+
releaseRegistrations?.();
456+
await Promise.all(registrationTasks);
451457

452458
// All 5 engines must be visible from any chunk
453459
const allIds = chunks[0].listContextEngineIds();

0 commit comments

Comments
 (0)