File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import path from "node:path";
88import { setTimeout as sleep } from "node:timers/promises" ;
99import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime" ;
1010import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared" ;
11+ import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime" ;
1112import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path" ;
1213import { startQaGatewayRpcClient } from "./gateway-rpc-client.js" ;
1314import { 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
You can’t perform that action at this time.
0 commit comments