fix(sdk): preserve zero run timeout watchdog · openclaw/openclaw@2bdcc83
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -790,9 +790,11 @@ export class RunsNamespace {
|
790 | 790 | constructor(private readonly client: OpenClaw) {} |
791 | 791 | |
792 | 792 | async create(params: RunCreateParams): Promise<Run> { |
793 | | -const raw = await this.client.request("agent", buildAgentParams(params), { |
| 793 | +const timeoutMs = normalizeTimeoutMs(params.timeoutMs); |
| 794 | +const normalizedParams = timeoutMs !== undefined ? { ...params, timeoutMs } : params; |
| 795 | +const raw = await this.client.request("agent", buildAgentParams(normalizedParams), { |
794 | 796 | expectFinal: false, |
795 | | -timeoutMs: params.timeoutMs, |
| 797 | +...(timeoutMs !== undefined ? { timeoutMs: timeoutMs === 0 ? null : timeoutMs } : {}), |
796 | 798 | }); |
797 | 799 | const record = asRecord(raw); |
798 | 800 | const runId = readOptionalString(record.runId); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -445,6 +445,11 @@ describe("OpenClaw SDK", () => {
|
445 | 445 | timeoutMs: 1_500, |
446 | 446 | idempotencyKey: "timeout-test", |
447 | 447 | }); |
| 448 | +await oc.runs.create({ |
| 449 | +input: "run without SDK watchdog", |
| 450 | +timeoutMs: 0, |
| 451 | +idempotencyKey: "no-watchdog-test", |
| 452 | +}); |
448 | 453 | |
449 | 454 | expect(requireTransportCall(transport.calls, 0)).toEqual({ |
450 | 455 | method: "agent", |
@@ -455,6 +460,15 @@ describe("OpenClaw SDK", () => {
|
455 | 460 | idempotencyKey: "timeout-test", |
456 | 461 | }, |
457 | 462 | }); |
| 463 | +expect(requireTransportCall(transport.calls, 1)).toEqual({ |
| 464 | +method: "agent", |
| 465 | +options: { expectFinal: false, timeoutMs: null }, |
| 466 | +params: { |
| 467 | +message: "run without SDK watchdog", |
| 468 | +timeout: 0, |
| 469 | +idempotencyKey: "no-watchdog-test", |
| 470 | +}, |
| 471 | +}); |
458 | 472 | await expect( |
459 | 473 | oc.runs.create({ |
460 | 474 | input: "bad timeout", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。