


























@@ -52,6 +52,8 @@ import { setupSkills } from "./onboard-skills.js";
5252type ConfigureSectionChoice = WizardSection | "__continue";
5353type SetupPluginConfigModule = typeof import("../wizard/setup.plugin-config.js");
545455+const GATEWAY_HINT_PROBE_TIMEOUT_MS = 300;
56+5557let setupPluginConfigModulePromise: Promise<SetupPluginConfigModule> | undefined;
56585759function loadSetupPluginConfigModule(): Promise<SetupPluginConfigModule> {
@@ -386,33 +388,42 @@ export async function runConfigureWizard(
386388}
387389388390const localUrl = "ws://127.0.0.1:18789";
389-const baseLocalProbeToken = await resolveGatewaySecretInputForWizard({
390-cfg: baseConfig,
391-value: baseConfig.gateway?.auth?.token,
392-path: "gateway.auth.token",
393-});
394-const baseLocalProbePassword = await resolveGatewaySecretInputForWizard({
395-cfg: baseConfig,
396-value: baseConfig.gateway?.auth?.password,
397-path: "gateway.auth.password",
398-});
399-const localProbe = await probeGatewayReachable({
400-url: localUrl,
401-token: process.env.OPENCLAW_GATEWAY_TOKEN ?? baseLocalProbeToken,
402-password: process.env.OPENCLAW_GATEWAY_PASSWORD ?? baseLocalProbePassword,
403-});
404391const remoteUrl = normalizeOptionalString(baseConfig.gateway?.remote?.url) ?? "";
405-const baseRemoteProbeToken = await resolveGatewaySecretInputForWizard({
406-cfg: baseConfig,
407-value: baseConfig.gateway?.remote?.token,
408-path: "gateway.remote.token",
409-});
410-const remoteProbe = remoteUrl
411- ? await probeGatewayReachable({
412-url: remoteUrl,
413-token: baseRemoteProbeToken,
414-})
415- : null;
392+const localProbePromise = (async () => {
393+const [baseLocalProbeToken, baseLocalProbePassword] = await Promise.all([
394+resolveGatewaySecretInputForWizard({
395+cfg: baseConfig,
396+value: baseConfig.gateway?.auth?.token,
397+path: "gateway.auth.token",
398+}),
399+resolveGatewaySecretInputForWizard({
400+cfg: baseConfig,
401+value: baseConfig.gateway?.auth?.password,
402+path: "gateway.auth.password",
403+}),
404+]);
405+return probeGatewayReachable({
406+url: localUrl,
407+token: process.env.OPENCLAW_GATEWAY_TOKEN ?? baseLocalProbeToken,
408+password: process.env.OPENCLAW_GATEWAY_PASSWORD ?? baseLocalProbePassword,
409+timeoutMs: GATEWAY_HINT_PROBE_TIMEOUT_MS,
410+});
411+})();
412+const remoteProbePromise = remoteUrl
413+ ? (async () => {
414+const baseRemoteProbeToken = await resolveGatewaySecretInputForWizard({
415+cfg: baseConfig,
416+value: baseConfig.gateway?.remote?.token,
417+path: "gateway.remote.token",
418+});
419+return probeGatewayReachable({
420+url: remoteUrl,
421+token: baseRemoteProbeToken,
422+timeoutMs: GATEWAY_HINT_PROBE_TIMEOUT_MS,
423+});
424+})()
425+ : Promise.resolve(null);
426+const [localProbe, remoteProbe] = await Promise.all([localProbePromise, remoteProbePromise]);
416427417428const mode = guardCancel(
418429await select({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。