

























@@ -2392,16 +2392,17 @@ describe("active-memory plugin", () => {
23922392});
2393239323942394it("ignores late subagent payloads once the active-memory timeout signal has fired", async () => {
2395+const CONFIGURED_TIMEOUT_MS = 25;
23952396__testing.setMinimumTimeoutMsForTests(1);
23962397__testing.setSetupGraceTimeoutMsForTests(0);
23972398api.pluginConfig = {
23982399agents: ["main"],
2399-timeoutMs: 1,
2400+timeoutMs: CONFIGURED_TIMEOUT_MS,
24002401logging: true,
24012402};
24022403plugin.register(api as unknown as OpenClawPluginApi);
24032404runEmbeddedPiAgent.mockImplementationOnce(async (params: { timeoutMs?: number }) => {
2404-await new Promise((resolve) => setTimeout(resolve, (params.timeoutMs ?? 0) + 1));
2405+await new Promise((resolve) => setTimeout(resolve, (params.timeoutMs ?? 0) + 25));
24052406return {
24062407payloads: [{ text: "late timeout payload that should never become memory context" }],
24072408meta: { aborted: true },
@@ -2433,12 +2434,13 @@ describe("active-memory plugin", () => {
24332434});
2434243524352436it("does not spend the model timeout budget on active-memory subagent setup", async () => {
2436-const CONFIGURED_TIMEOUT_MS = 10;
2437+const CONFIGURED_TIMEOUT_MS = 50;
2438+const SETUP_GRACE_TIMEOUT_MS = 500;
24372439__testing.setMinimumTimeoutMsForTests(1);
24382440api.pluginConfig = {
24392441agents: ["main"],
24402442timeoutMs: CONFIGURED_TIMEOUT_MS,
2441-setupGraceTimeoutMs: 100,
2443+setupGraceTimeoutMs: SETUP_GRACE_TIMEOUT_MS,
24422444logging: true,
24432445};
24442446plugin.register(api as unknown as OpenClawPluginApi);
@@ -2458,7 +2460,9 @@ describe("active-memory plugin", () => {
24582460);
2459246124602462expect(result?.prependContext).toContain("remember the ramen place");
2461-expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]?.timeoutMs).toBe(CONFIGURED_TIMEOUT_MS + 100);
2463+expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]?.timeoutMs).toBe(
2464+CONFIGURED_TIMEOUT_MS + SETUP_GRACE_TIMEOUT_MS,
2465+);
24622466const infoLines = vi
24632467.mocked(api.logger.info)
24642468.mock.calls.map((call: unknown[]) => String(call[0]));
@@ -3607,11 +3611,12 @@ describe("active-memory plugin", () => {
36073611});
3608361236093613it("skips recall after consecutive timeouts when circuit breaker trips (#74054)", async () => {
3614+const CONFIGURED_TIMEOUT_MS = 25;
36103615__testing.setMinimumTimeoutMsForTests(1);
36113616__testing.setSetupGraceTimeoutMsForTests(0);
36123617api.pluginConfig = {
36133618agents: ["main"],
3614-timeoutMs: 1,
3619+timeoutMs: CONFIGURED_TIMEOUT_MS,
36153620logging: true,
36163621circuitBreakerMaxTimeouts: 2,
36173622circuitBreakerCooldownMs: 60_000,
@@ -3662,11 +3667,12 @@ describe("active-memory plugin", () => {
36623667});
3663366836643669it("resets circuit breaker after a successful recall", async () => {
3670+const CONFIGURED_TIMEOUT_MS = 25;
36653671__testing.setMinimumTimeoutMsForTests(1);
36663672__testing.setSetupGraceTimeoutMsForTests(0);
36673673api.pluginConfig = {
36683674agents: ["main"],
3669-timeoutMs: 50,
3675+timeoutMs: CONFIGURED_TIMEOUT_MS,
36703676logging: true,
36713677circuitBreakerMaxTimeouts: 1,
36723678circuitBreakerCooldownMs: 60_000,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。