test(agents): harden code mode wait timeout · openclaw/openclaw@61ef6b1
vincentkoc
·
2026-05-30
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -500,7 +500,6 @@ describe("Code Mode", () => {
|
500 | 500 | tools: { |
501 | 501 | codeMode: { |
502 | 502 | enabled: true, |
503 | | -timeoutMs: 100, |
504 | 503 | }, |
505 | 504 | }, |
506 | 505 | } as never; |
@@ -543,9 +542,18 @@ describe("Code Mode", () => {
|
543 | 542 | ); |
544 | 543 | expect(first.status).toBe("waiting"); |
545 | 544 | expect(first.pendingToolCalls).toHaveLength(2); |
| 545 | +const runId = first.runId; |
| 546 | +expect(typeof runId).toBe("string"); |
| 547 | +if (typeof runId !== "string") { |
| 548 | +throw new Error("expected code mode run id"); |
| 549 | +} |
| 550 | + |
| 551 | +const activeRun = testing.activeRuns.get(runId); |
| 552 | +expect(activeRun).toBeDefined(); |
| 553 | +activeRun!.config.timeoutMs = 100; |
546 | 554 | |
547 | 555 | const second = resultDetails( |
548 | | -await codeModeTools[1].execute("code-wait-timeout", { runId: first.runId }), |
| 556 | +await codeModeTools[1].execute("code-wait-timeout", { runId }), |
549 | 557 | ); |
550 | 558 | |
551 | 559 | expect(second.status).toBe("waiting"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。