Skip to content

Commit 3f2c3a6

Browse files
committed
fix(release): stabilize slow live release gates
1 parent c7b5302 commit 3f2c3a6

4 files changed

Lines changed: 115 additions & 27 deletions

File tree

‎scripts/lib/docker-e2e-plan.mjs‎

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,33 @@ function parseUpgradeSurvivorScenarios(raw) {
147147
];
148148
}
149149

150+
function parsePublishedReleaseVersion(spec) {
151+
const match = /^openclaw@([0-9]{4})\.([0-9]+)\.([0-9]+)/u.exec(String(spec ?? ""));
152+
if (!match) {
153+
return null;
154+
}
155+
return {
156+
year: Number(match[1]),
157+
month: Number(match[2]),
158+
day: Number(match[3]),
159+
};
160+
}
161+
162+
function comparePublishedReleaseVersion(a, b) {
163+
return a.year - b.year || a.month - b.month || a.day - b.day;
164+
}
165+
166+
function supportsUpgradeSurvivorPluginDependencyCleanup(baselineSpec) {
167+
if (!baselineSpec) {
168+
return true;
169+
}
170+
const version = parsePublishedReleaseVersion(baselineSpec);
171+
if (!version) {
172+
return true;
173+
}
174+
return comparePublishedReleaseVersion(version, { year: 2026, month: 4, day: 23 }) >= 0;
175+
}
176+
150177
function expandUpgradeSurvivorBaselineLanes(poolLanes, rawBaselineSpecs, rawScenarios = "") {
151178
const baselineSpecs = parseUpgradeSurvivorBaselineSpecs(rawBaselineSpecs);
152179
const scenarios = parseUpgradeSurvivorScenarios(rawScenarios);
@@ -160,30 +187,38 @@ function expandUpgradeSurvivorBaselineLanes(poolLanes, rawBaselineSpecs, rawScen
160187
const matrixBaselines = baselineSpecs.length > 0 ? baselineSpecs : [undefined];
161188
const matrixScenarios = scenarios.length > 0 ? scenarios : [undefined];
162189
return matrixBaselines.flatMap((baselineSpec) =>
163-
matrixScenarios.map((scenario) => {
164-
const suffixParts = [
165-
baselineSpec ? sanitizeLaneNameSuffix(baselineSpec) : "",
166-
scenario && scenario !== "base" ? sanitizeLaneNameSuffix(scenario) : "",
167-
].filter(Boolean);
168-
const suffix = suffixParts.join("-");
169-
const name = suffix ? `${poolLane.name}-${suffix}` : poolLane.name;
170-
const commandPrefix = [
171-
`OPENCLAW_UPGRADE_SURVIVOR_ARTIFACT_DIR="$PWD/.artifacts/upgrade-survivor/${name}"`,
172-
baselineSpec ? `OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPEC=${shellQuote(baselineSpec)}` : "",
173-
scenario ? `OPENCLAW_UPGRADE_SURVIVOR_SCENARIO=${shellQuote(scenario)}` : "",
174-
]
175-
.filter(Boolean)
176-
.join(" ");
177-
return Object.assign({}, poolLane, {
178-
cacheKey: poolLane.cacheKey
179-
? suffix
180-
? `${poolLane.cacheKey}-${suffix}`
181-
: poolLane.cacheKey
182-
: name,
183-
command: commandPrefix ? `${commandPrefix} ${poolLane.command}` : poolLane.command,
184-
name,
185-
});
186-
}),
190+
matrixScenarios
191+
.filter(
192+
(scenario) =>
193+
scenario !== "plugin-deps-cleanup" ||
194+
supportsUpgradeSurvivorPluginDependencyCleanup(baselineSpec),
195+
)
196+
.map((scenario) => {
197+
const suffixParts = [
198+
baselineSpec ? sanitizeLaneNameSuffix(baselineSpec) : "",
199+
scenario && scenario !== "base" ? sanitizeLaneNameSuffix(scenario) : "",
200+
].filter(Boolean);
201+
const suffix = suffixParts.join("-");
202+
const name = suffix ? `${poolLane.name}-${suffix}` : poolLane.name;
203+
const commandPrefix = [
204+
`OPENCLAW_UPGRADE_SURVIVOR_ARTIFACT_DIR="$PWD/.artifacts/upgrade-survivor/${name}"`,
205+
baselineSpec
206+
? `OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPEC=${shellQuote(baselineSpec)}`
207+
: "",
208+
scenario ? `OPENCLAW_UPGRADE_SURVIVOR_SCENARIO=${shellQuote(scenario)}` : "",
209+
]
210+
.filter(Boolean)
211+
.join(" ");
212+
return Object.assign({}, poolLane, {
213+
cacheKey: poolLane.cacheKey
214+
? suffix
215+
? `${poolLane.cacheKey}-${suffix}`
216+
: poolLane.cacheKey
217+
: name,
218+
command: commandPrefix ? `${commandPrefix} ${poolLane.command}` : poolLane.command,
219+
name,
220+
});
221+
}),
187222
);
188223
});
189224
}

‎scripts/openclaw-cross-os-release-checks.ts‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,19 @@ const SUPPORTED_SUITES = new Set([
3434
"dev-update",
3535
]);
3636

37+
export const CROSS_OS_AGENT_TURN_TIMEOUT_SECONDS = parsePositiveIntegerEnv(
38+
"OPENCLAW_CROSS_OS_AGENT_TURN_TIMEOUT_SECONDS",
39+
1200,
40+
);
41+
3742
const providerConfig = {
3843
openai: {
3944
extensionId: "openai",
4045
secretEnv: "OPENAI_API_KEY",
4146
authChoice: "openai-api-key",
4247
model: "openai/gpt-5.4",
4348
baseUrl: "https://api.openai.com/v1",
44-
timeoutSeconds: 600,
49+
timeoutSeconds: CROSS_OS_AGENT_TURN_TIMEOUT_SECONDS,
4550
},
4651
anthropic: {
4752
extensionId: "anthropic",
@@ -112,7 +117,6 @@ export const CROSS_OS_GATEWAY_STATUS_COMMAND_TIMEOUT_MS =
112117
CROSS_OS_GATEWAY_STATUS_RPC_TIMEOUT_MS + 45_000;
113118
export const CROSS_OS_GATEWAY_READY_TIMEOUT_MS = 3 * 60_000;
114119
export const CROSS_OS_WINDOWS_GATEWAY_READY_TIMEOUT_MS = 5 * 60_000;
115-
export const CROSS_OS_AGENT_TURN_TIMEOUT_SECONDS = 600;
116120
export const CROSS_OS_RELEASE_SMOKE_TOOLS_PROFILE = "minimal";
117121

118122
if (isMainModule()) {
@@ -151,6 +155,18 @@ export function parseArgs(argv) {
151155
return parsed;
152156
}
153157

158+
function parsePositiveIntegerEnv(name, fallback) {
159+
const raw = process.env[name]?.trim();
160+
if (!raw) {
161+
return fallback;
162+
}
163+
const value = Number(raw);
164+
if (!Number.isSafeInteger(value) || value <= 0) {
165+
throw new Error(`${name} must be a positive integer. Got: ${JSON.stringify(raw)}`);
166+
}
167+
return value;
168+
}
169+
154170
export function looksLikeReleaseVersionRef(ref) {
155171
const trimmed = normalizeRequestedRef(ref);
156172
return /^v?[0-9]{4}\.[0-9]+\.[0-9]+(?:-(?:[1-9][0-9]*)|[-.](?:beta|rc)[-.]?[0-9]+)?$/iu.test(

‎src/gateway/gateway-cli-backend.live.test.ts‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,27 @@ const DEFAULT_MODEL =
5656
// The cron/MCP live probe now tolerates more cancelled tool-call retries in CI,
5757
// so the outer test budget needs enough headroom to finish those retries.
5858
const CLI_BACKEND_LIVE_TIMEOUT_MS = 20 * 60_000;
59-
const CLI_BACKEND_REQUEST_TIMEOUT_MS = 600_000;
59+
const CLI_BACKEND_REQUEST_TIMEOUT_MS = parsePositiveIntegerEnv(
60+
"OPENCLAW_LIVE_CLI_BACKEND_REQUEST_TIMEOUT_MS",
61+
15 * 60_000,
62+
);
6063
const CLI_BACKEND_AGENT_TIMEOUT_SECONDS = Math.max(
6164
1,
6265
Math.ceil(CLI_BACKEND_REQUEST_TIMEOUT_MS / 1000) - 10,
6366
);
6467

68+
function parsePositiveIntegerEnv(name: string, fallback: number): number {
69+
const raw = process.env[name]?.trim();
70+
if (!raw) {
71+
return fallback;
72+
}
73+
const value = Number(raw);
74+
if (!Number.isSafeInteger(value) || value <= 0) {
75+
throw new Error(`${name} must be a positive integer. Got: ${JSON.stringify(raw)}`);
76+
}
77+
return value;
78+
}
79+
6580
function logCliBackendLiveStep(step: string, details?: Record<string, unknown>): void {
6681
if (!CLI_DEBUG) {
6782
return;

‎test/scripts/docker-e2e-plan.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,28 @@ describe("scripts/lib/docker-e2e-plan", () => {
358358
]);
359359
});
360360

361+
it("skips plugin dependency cleanup for baselines without packaged plugin dirs", () => {
362+
const plan = planFor({
363+
selectedLaneNames: ["published-upgrade-survivor"],
364+
upgradeSurvivorBaselines: "2026.4.29 2026.3.13",
365+
upgradeSurvivorScenarios: "reported-issues",
366+
});
367+
368+
expect(plan.lanes.map((lane) => lane.name)).toEqual([
369+
"published-upgrade-survivor-2026.4.29",
370+
"published-upgrade-survivor-2026.4.29-feishu-channel",
371+
"published-upgrade-survivor-2026.4.29-bootstrap-persona",
372+
"published-upgrade-survivor-2026.4.29-plugin-deps-cleanup",
373+
"published-upgrade-survivor-2026.4.29-tilde-log-path",
374+
"published-upgrade-survivor-2026.4.29-versioned-runtime-deps",
375+
"published-upgrade-survivor-2026.3.13",
376+
"published-upgrade-survivor-2026.3.13-feishu-channel",
377+
"published-upgrade-survivor-2026.3.13-bootstrap-persona",
378+
"published-upgrade-survivor-2026.3.13-tilde-log-path",
379+
"published-upgrade-survivor-2026.3.13-versioned-runtime-deps",
380+
]);
381+
});
382+
361383
it("expands update migration across baselines and cleanup scenarios", () => {
362384
const plan = planFor({
363385
selectedLaneNames: ["update-migration"],

0 commit comments

Comments
 (0)