

























@@ -35,6 +35,28 @@ function readConfigSection(fileName) {
3535return JSON.stringify(JSON.parse(fs.readFileSync(fileUrl, "utf8")));
3636}
373738+function parseReleaseVersion(version) {
39+const match = /^([0-9]{4})\.([0-9]+)\.([0-9]+)/u.exec(String(version ?? ""));
40+if (!match) {
41+return null;
42+}
43+return match.slice(1).map((part) => Number.parseInt(part, 10));
44+}
45+46+function isReleaseBefore(version, minimum) {
47+const parsed = parseReleaseVersion(version);
48+const minimumParsed = parseReleaseVersion(minimum);
49+if (!parsed || !minimumParsed) {
50+return false;
51+}
52+for (let index = 0; index < parsed.length; index += 1) {
53+if (parsed[index] !== minimumParsed[index]) {
54+return parsed[index] < minimumParsed[index];
55+}
56+}
57+return false;
58+}
59+3860function configSetJsonFile(id, intent, configPath, fileName) {
3961return {
4062 id,
@@ -112,6 +134,45 @@ function selectedScenario() {
112134return process.env.OPENCLAW_UPGRADE_SURVIVOR_SCENARIO || "base";
113135}
114136137+function adaptStepForBaseline(step, baselineVersion, summary) {
138+if (!isReleaseBefore(baselineVersion, "2026.4.0")) {
139+return step;
140+}
141+if (step.id === "plugins-feishu" || step.id === "channels-feishu") {
142+if (!summary.skippedIntents.includes("feishu-channel")) {
143+summary.skippedIntents.push("feishu-channel");
144+}
145+return null;
146+}
147+if (step.id === "agents") {
148+const agents = JSON.parse(step.argv[3]);
149+delete agents.defaults?.skills;
150+for (const agent of agents.list ?? []) {
151+delete agent.thinkingDefault;
152+delete agent.fastModeDefault;
153+delete agent.skills;
154+}
155+summary.skippedIntents.push("agent-modern-preferences");
156+return {
157+ ...step,
158+argv: [...step.argv.slice(0, 3), JSON.stringify(agents), ...step.argv.slice(4)],
159+};
160+}
161+if (step.intent === "plugins") {
162+const plugins = JSON.parse(step.argv[3]);
163+plugins.allow = (plugins.allow ?? []).filter((id) => id !== "memory");
164+delete plugins.entries?.memory;
165+if (!summary.skippedIntents.includes("memory-plugin-allow")) {
166+summary.skippedIntents.push("memory-plugin-allow");
167+}
168+return {
169+ ...step,
170+argv: [...step.argv.slice(0, 3), JSON.stringify(plugins), ...step.argv.slice(4)],
171+};
172+}
173+return step;
174+}
175+115176function runOpenClaw(step) {
116177const result = spawnSync("openclaw", step.argv, {
117178encoding: "utf8",
@@ -156,7 +217,11 @@ function applyRecipe() {
156217};
157218158219for (const step of [...recipe.slice(0, -1), ...scenarioSteps, recipe.at(-1)]) {
159-const outcome = runOpenClaw(step);
220+const adaptedStep = adaptStepForBaseline(step, baselineVersion, summary);
221+if (!adaptedStep) {
222+continue;
223+}
224+const outcome = runOpenClaw(adaptedStep);
160225summary.steps.push(outcome);
161226writeJson(summaryPath, summary);
162227if (!outcome.ok) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。