fix(context-engine): forward abortSignal through delegation bridge to… · openclaw/openclaw@e0d7776
openperf
·
2026-06-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -603,6 +603,32 @@ describe("Engine contract tests", () => {
|
603 | 603 | }); |
604 | 604 | }); |
605 | 605 | |
| 606 | +it("delegateCompactionToRuntime forwards the caller abortSignal to the runtime (#89868)", async () => { |
| 607 | +installCompactRuntimeSpy(); |
| 608 | +const controller = new AbortController(); |
| 609 | +await delegateCompactionToRuntime({ |
| 610 | +sessionId: "s-abort", |
| 611 | +sessionFile: "/tmp/session-abort.json", |
| 612 | +tokenBudget: 4096, |
| 613 | +abortSignal: controller.signal, |
| 614 | +}); |
| 615 | + |
| 616 | +const compactRuntimeParams = requireCompactRuntimeParams(0); |
| 617 | +expect(compactRuntimeParams.abortSignal).toBe(controller.signal); |
| 618 | +}); |
| 619 | + |
| 620 | +it("delegateCompactionToRuntime passes undefined abortSignal when none supplied", async () => { |
| 621 | +installCompactRuntimeSpy(); |
| 622 | +await delegateCompactionToRuntime({ |
| 623 | +sessionId: "s-no-abort", |
| 624 | +sessionFile: "/tmp/session-no-abort.json", |
| 625 | +tokenBudget: 4096, |
| 626 | +}); |
| 627 | + |
| 628 | +const compactRuntimeParams = requireCompactRuntimeParams(0); |
| 629 | +expect(compactRuntimeParams.abortSignal).toBeUndefined(); |
| 630 | +}); |
| 631 | + |
606 | 632 | it("builds a normalized memory system prompt addition from the active memory prompt path", () => { |
607 | 633 | registerMemoryPromptSection(({ citationsMode }) => [ |
608 | 634 | "## Memory Recall", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -60,6 +60,7 @@ export async function delegateCompactionToRuntime(
|
60 | 60 | ...(currentTokenCount !== undefined ? { currentTokenCount } : {}), |
61 | 61 | force: params.force, |
62 | 62 | customInstructions: params.customInstructions, |
| 63 | +abortSignal: params.abortSignal, |
63 | 64 | workspaceDir: |
64 | 65 | typeof runtimeContext.workspaceDir === "string" ? runtimeContext.workspaceDir : process.cwd(), |
65 | 66 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。