fix(gateway): honor remote status probe timeout (#89859) · openclaw/openclaw@9ce4c92
mushuiyu886
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -983,6 +983,15 @@ describe("gateway-status command", () => {
|
983 | 983 | ]); |
984 | 984 | }); |
985 | 985 | |
| 986 | +it("passes the full caller timeout through to active configured remote probes", async () => { |
| 987 | +const { runtime } = createRuntimeCapture(); |
| 988 | +probeGateway.mockClear(); |
| 989 | + |
| 990 | +await runGatewayStatus(runtime, { timeout: "15000", json: true }); |
| 991 | + |
| 992 | +expect(requireProbeCall("wss://remote.example:18789").timeoutMs).toBe(15_000); |
| 993 | +}); |
| 994 | + |
986 | 995 | it("uses configured handshake timeout as the default local probe budget", async () => { |
987 | 996 | const { runtime } = createRuntimeCapture(); |
988 | 997 | probeGateway.mockClear(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -436,20 +436,30 @@ describe("resolveProbeBudgetMs", () => {
|
436 | 436 | ).toBe(2_500); |
437 | 437 | }); |
438 | 438 | |
439 | | -it("keeps non-local probe caps unchanged", () => { |
| 439 | +it("lets active remote probes use the full caller budget", () => { |
440 | 440 | expect( |
441 | 441 | resolveProbeBudgetMs(15_000, { |
442 | 442 | kind: "configRemote", |
443 | 443 | active: true, |
444 | 444 | url: "wss://gateway.example/ws", |
445 | 445 | }), |
446 | | -).toBe(1500); |
| 446 | +).toBe(15_000); |
447 | 447 | expect( |
448 | 448 | resolveProbeBudgetMs(15_000, { |
449 | 449 | kind: "explicit", |
450 | 450 | active: true, |
451 | 451 | url: "wss://gateway.example/ws", |
452 | 452 | }), |
| 453 | +).toBe(15_000); |
| 454 | +}); |
| 455 | + |
| 456 | +it("keeps inactive remote and SSH tunnel probes on the short cap", () => { |
| 457 | +expect( |
| 458 | +resolveProbeBudgetMs(15_000, { |
| 459 | +kind: "configRemote", |
| 460 | +active: false, |
| 461 | +url: "wss://gateway.example/ws", |
| 462 | +}), |
453 | 463 | ).toBe(1500); |
454 | 464 | expect( |
455 | 465 | resolveProbeBudgetMs(15_000, { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -150,15 +150,15 @@ export function resolveProbeBudgetMs(
|
150 | 150 | if (target.kind === "sshTunnel") { |
151 | 151 | return Math.min(2000, overallMs); |
152 | 152 | } |
153 | | -if (!isLoopbackProbeTarget(target)) { |
154 | | -return Math.min(1500, overallMs); |
| 153 | +if (target.active) { |
| 154 | +return overallMs; |
155 | 155 | } |
156 | | -if (target.kind === "localLoopback" && !target.active) { |
| 156 | +if (target.kind === "localLoopback") { |
157 | 157 | return Math.min(800, overallMs); |
158 | 158 | } |
159 | | -// Active/discovered loopback probes and explicit loopback URLs should honor |
160 | | -// the caller budget because healthy local detail RPCs can legitimately take |
161 | | -// longer than the legacy short caps. |
| 159 | +if (!isLoopbackProbeTarget(target)) { |
| 160 | + return Math.min(1500, overallMs); |
| 161 | +} |
162 | 162 | return overallMs; |
163 | 163 | } |
164 | 164 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。