























@@ -55,6 +55,16 @@ const providerConfig = {
5555},
5656};
575758+export function resolveProviderConfig(provider, env = process.env) {
59+const config = providerConfig[provider];
60+if (!config) {
61+return null;
62+}
63+const providerEnvKey = `OPENCLAW_CROSS_OS_${provider.toUpperCase().replace(/[^A-Z0-9]+/gu, "_")}_MODEL`;
64+const model = env[providerEnvKey]?.trim() || env.OPENCLAW_CROSS_OS_MODEL?.trim() || config.model;
65+return { ...config, model };
66+}
67+5868const RELEASE_SMOKE_PLUGIN_ALLOWLIST_BASE = [
5969"acpx",
6070"bonjour",
@@ -304,7 +314,7 @@ async function main(argv) {
304314throw new Error(`Unsupported provider "${provider}".`);
305315}
306316307-const selectedProvider = providerConfig[provider];
317+const selectedProvider = resolveProviderConfig(provider);
308318const providerSecretValue = process.env[selectedProvider.secretEnv]?.trim();
309319if (!providerSecretValue) {
310320throw new Error(`Missing ${selectedProvider.secretEnv}.`);
@@ -1882,30 +1892,36 @@ async function runInstalledModelsSet(params) {
18821892}
1883189318841894async function runInstalledAgentTurn(params) {
1885-const sessionId = `cross-os-release-check-${params.label}-${Date.now()}`;
1886-const result = await runInstalledCli({
1887-cliPath: params.cliPath,
1888-args: [
1889-"agent",
1890-"--agent",
1891-"main",
1892-"--session-id",
1893-sessionId,
1894-"--message",
1895-"Reply with exact ASCII text OK only.",
1896-"--thinking",
1897-"minimal",
1898-"--json",
1899-],
1900-cwd: params.cwd,
1901-env: params.env,
1902-logPath: params.logPath,
1903-timeoutMs: 10 * 60 * 1000,
1904-});
1905-if (!agentOutputHasExpectedOkMarker(result.stdout, { logPath: params.logPath })) {
1906-throw new Error("Agent output did not contain the expected OK marker.");
1895+let lastError;
1896+for (let attempt = 1; attempt <= 2; attempt += 1) {
1897+const sessionId = `cross-os-release-check-${params.label}-${Date.now()}-${attempt}`;
1898+try {
1899+const result = await runInstalledCli({
1900+cliPath: params.cliPath,
1901+args: buildReleaseAgentTurnArgs(sessionId),
1902+cwd: params.cwd,
1903+env: params.env,
1904+logPath: params.logPath,
1905+timeoutMs: 10 * 60 * 1000,
1906+});
1907+if (!agentOutputHasExpectedOkMarker(result.stdout, { logPath: params.logPath })) {
1908+throw new Error("Agent output did not contain the expected OK marker.");
1909+}
1910+return result;
1911+} catch (error) {
1912+lastError = error;
1913+if (attempt >= 2 || !shouldRetryCrossOsAgentTurnError(error)) {
1914+throw error;
1915+}
1916+appendFileSync(
1917+params.logPath,
1918+`\n[release-checks] retrying installed agent turn after retryable live failure: ${
1919+ error instanceof Error ? error.message : String(error)
1920+ }\n`,
1921+);
1922+}
19071923}
1908-return result;
1924+throw lastError;
19091925}
1910192619111927export function verifyDevUpdateStatus(stdout, options = {}) {
@@ -2657,18 +2673,7 @@ async function runAgentTurn(params) {
26572673const result = await runOpenClaw({
26582674lane: params.lane,
26592675env: params.env,
2660-args: [
2661-"agent",
2662-"--agent",
2663-"main",
2664-"--session-id",
2665-sessionId,
2666-"--message",
2667-"Reply with exact ASCII text OK only.",
2668-"--thinking",
2669-"minimal",
2670-"--json",
2671-],
2676+args: buildReleaseAgentTurnArgs(sessionId),
26722677logPath: params.logPath,
26732678timeoutMs: 10 * 60 * 1000,
26742679});
@@ -2683,7 +2688,7 @@ async function runAgentTurn(params) {
26832688}
26842689appendFileSync(
26852690params.logPath,
2686-`\n[release-checks] retrying agent turn after bundled runtime deps staging failure: ${
2691+`\n[release-checks] retrying agent turn after retryable live failure: ${
26872692 error instanceof Error ? error.message : String(error)
26882693 }\n`,
26892694);
@@ -2692,9 +2697,24 @@ async function runAgentTurn(params) {
26922697throw lastError;
26932698}
269426992700+function buildReleaseAgentTurnArgs(sessionId) {
2701+return [
2702+"agent",
2703+"--agent",
2704+"main",
2705+"--session-id",
2706+sessionId,
2707+"--message",
2708+"Reply with exact ASCII text OK only.",
2709+"--thinking",
2710+"minimal",
2711+"--json",
2712+];
2713+}
2714+26952715export function shouldRetryCrossOsAgentTurnError(error) {
26962716const message = error instanceof Error ? error.message : String(error);
2697-return /failed to (?:install|stage) bundled runtime deps|failed to stage bundled runtime deps after/u.test(
2717+return /failed to (?:install|stage) bundled runtime deps|failed to stage bundled runtime deps after|Agent output did not contain the expected OK marker|model idle timeout|did not produce a response before the model idle timeout/u.test(
26982718message,
26992719);
27002720}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。