Skip to content

Commit ddfd6c3

Browse files
committed
fix: guard QA lab gateway health fetch (#64242)
1 parent 09a8e0f commit ddfd6c3

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

extensions/qa-lab/src/gateway-child.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import path from "node:path";
88
import { setTimeout as sleep } from "node:timers/promises";
99
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
1010
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared";
11+
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
1112
import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
1213
import { startQaGatewayRpcClient } from "./gateway-rpc-client.js";
1314
import { splitQaModelRef } from "./model-selection.js";
@@ -526,11 +527,20 @@ async function waitForGatewayReady(params: {
526527
}
527528
for (const healthPath of ["/readyz", "/healthz"]) {
528529
try {
529-
const response = await fetch(`${params.baseUrl}${healthPath}`, {
530-
signal: AbortSignal.timeout(2_000),
530+
const { response, release } = await fetchWithSsrFGuard({
531+
url: `${params.baseUrl}${healthPath}`,
532+
init: {
533+
signal: AbortSignal.timeout(2_000),
534+
},
535+
policy: { allowPrivateNetwork: true },
536+
auditContext: "qa-lab-gateway-child-health",
531537
});
532-
if (response.ok) {
533-
return;
538+
try {
539+
if (response.ok) {
540+
return;
541+
}
542+
} finally {
543+
await release();
534544
}
535545
} catch {
536546
// retry until timeout

0 commit comments

Comments
 (0)