refactor: simplify plugin dependency handling

Simplify plugin installation and runtime loading around package-manager-owned dependencies, with Jiti reserved for local/TS fallback paths.

Also scans npm plugin install roots so hoisted transitive dependencies are covered by dependency denylist and node_modules symlink checks.
This commit is contained in:
Peter Steinberger
2026-05-01 21:32:22 +01:00
committed by GitHub
parent 2e8e9cd6ca
commit ed8f50f240
294 changed files with 2562 additions and 25454 deletions

View File

@@ -2,8 +2,6 @@
// Keep lane names, commands, image kind, timeout, resources, and release chunks
// here. Planning and execution live in separate modules.
const BUNDLED_UPDATE_NO_OUTPUT_TIMEOUT_MS = 4 * 60 * 1000;
const BUNDLED_UPDATE_TIMEOUT_MS = 6 * 60 * 1000;
export const DEFAULT_LIVE_RETRIES = 1;
const LIVE_ACP_TIMEOUT_MS = 20 * 60 * 1000;
const LIVE_CLI_TIMEOUT_MS = 20 * 60 * 1000;
@@ -21,9 +19,6 @@ export const LIVE_RETRY_PATTERNS = [
/ECONNRESET|ETIMEDOUT|ENOTFOUND/i,
];
const bundledChannelLaneCommand =
"OPENCLAW_SKIP_DOCKER_BUILD=1 OPENCLAW_BUNDLED_CHANNEL_UPDATE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_ROOT_OWNED_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_SETUP_ENTRY_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_LOAD_FAILURE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_DISABLED_CONFIG_SCENARIO=0 pnpm test:docker:bundled-channel-deps";
function liveDockerScriptCommand(script, envPrefix = "") {
const prefix = envPrefix ? `${envPrefix} ` : "";
return `${prefix}OPENCLAW_SKIP_DOCKER_BUILD=1 bash -c 'harness="\${OPENCLAW_DOCKER_E2E_TRUSTED_HARNESS_DIR:-}"; if [ -z "$harness" ]; then if [ -d .release-harness/scripts ]; then harness=.release-harness; else harness=.; fi; fi; OPENCLAW_LIVE_DOCKER_REPO_ROOT="\${OPENCLAW_DOCKER_E2E_REPO_ROOT:-$PWD}" bash "$harness/scripts/${script}"'`;
@@ -108,72 +103,6 @@ function serviceLane(name, command, options = {}) {
});
}
function bundledChannelScenarioLane(name, env, options = {}) {
return npmLane(
name,
`${env} OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:bundled-channel-deps`,
options,
);
}
const bundledChannelSmokeLanes = ["telegram", "discord", "slack", "feishu", "memory-lancedb"].map(
(channel) =>
npmLane(
`bundled-channel-${channel}`,
`OPENCLAW_BUNDLED_CHANNELS=${channel} ${bundledChannelLaneCommand}`,
{ stateScenario: "empty" },
),
);
const bundledChannelUpdateLanes = [
"telegram",
"discord",
"slack",
"feishu",
"memory-lancedb",
"acpx",
].map((target) =>
bundledChannelScenarioLane(
`bundled-channel-update-${target}`,
`OPENCLAW_BUNDLED_CHANNEL_SCENARIOS=0 OPENCLAW_BUNDLED_CHANNEL_UPDATE_SCENARIO=1 OPENCLAW_BUNDLED_CHANNEL_UPDATE_TARGETS=${target} OPENCLAW_BUNDLED_CHANNEL_ROOT_OWNED_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_SETUP_ENTRY_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_LOAD_FAILURE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_DISABLED_CONFIG_SCENARIO=0`,
{
noOutputTimeoutMs: BUNDLED_UPDATE_NO_OUTPUT_TIMEOUT_MS,
retryPatterns: LIVE_RETRY_PATTERNS,
retries: 1,
stateScenario: "empty",
timeoutMs: BUNDLED_UPDATE_TIMEOUT_MS,
},
),
);
const bundledChannelContractLanes = [
bundledChannelScenarioLane(
"bundled-channel-root-owned",
"OPENCLAW_BUNDLED_CHANNEL_SCENARIOS=0 OPENCLAW_BUNDLED_CHANNEL_UPDATE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_ROOT_OWNED_SCENARIO=1 OPENCLAW_BUNDLED_CHANNEL_SETUP_ENTRY_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_LOAD_FAILURE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_DISABLED_CONFIG_SCENARIO=0",
),
bundledChannelScenarioLane(
"bundled-channel-setup-entry",
"OPENCLAW_BUNDLED_CHANNEL_SCENARIOS=0 OPENCLAW_BUNDLED_CHANNEL_UPDATE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_ROOT_OWNED_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_SETUP_ENTRY_SCENARIO=1 OPENCLAW_BUNDLED_CHANNEL_LOAD_FAILURE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_DISABLED_CONFIG_SCENARIO=0",
{ stateScenario: "empty" },
),
bundledChannelScenarioLane(
"bundled-channel-load-failure",
"OPENCLAW_BUNDLED_CHANNEL_SCENARIOS=0 OPENCLAW_BUNDLED_CHANNEL_UPDATE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_ROOT_OWNED_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_SETUP_ENTRY_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_LOAD_FAILURE_SCENARIO=1 OPENCLAW_BUNDLED_CHANNEL_DISABLED_CONFIG_SCENARIO=0",
{ stateScenario: "empty" },
),
bundledChannelScenarioLane(
"bundled-channel-disabled-config",
"OPENCLAW_BUNDLED_CHANNEL_SCENARIOS=0 OPENCLAW_BUNDLED_CHANNEL_UPDATE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_ROOT_OWNED_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_SETUP_ENTRY_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_LOAD_FAILURE_SCENARIO=0 OPENCLAW_BUNDLED_CHANNEL_DISABLED_CONFIG_SCENARIO=1",
{ stateScenario: "empty" },
),
];
const bundledScenarioLanes = [
...bundledChannelSmokeLanes,
...bundledChannelUpdateLanes,
...bundledChannelContractLanes,
];
const bundledPluginInstallUninstallLanes = Array.from(
{ length: BUNDLED_PLUGIN_INSTALL_UNINSTALL_SHARDS },
(_, index) =>
@@ -313,18 +242,12 @@ export const mainLanes = [
weight: 6,
},
),
npmLane(
"bundled-channel-deps-compat",
"OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:bundled-channel-deps:fast",
{ resources: ["service"], stateScenario: "empty", weight: 3 },
),
npmLane("plugin-update", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:plugin-update", {
stateScenario: "empty",
}),
serviceLane("config-reload", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:config-reload", {
stateScenario: "empty",
}),
...bundledScenarioLanes,
lane("openai-image-auth", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:openai-image-auth", {
stateScenario: "empty",
}),
@@ -504,7 +427,6 @@ const releasePathBundledChannelLanes = [
npmLane("plugin-update", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:plugin-update", {
stateScenario: "empty",
}),
...bundledScenarioLanes,
];
const releasePathPackageInstallOpenAiLanes = [
@@ -606,15 +528,6 @@ const primaryReleasePathChunks = {
"plugins-runtime-install-f": bundledPluginInstallUninstallLanes.slice(15, 18),
"plugins-runtime-install-g": bundledPluginInstallUninstallLanes.slice(18, 21),
"plugins-runtime-install-h": bundledPluginInstallUninstallLanes.slice(21),
"bundled-channels-core": [releasePathBundledChannelLanes[0], ...bundledChannelSmokeLanes],
"bundled-channels-update-a": [bundledChannelUpdateLanes[0], bundledChannelUpdateLanes[4]],
"bundled-channels-update-discord": [bundledChannelUpdateLanes[1]],
"bundled-channels-update-b": [
bundledChannelUpdateLanes[2],
bundledChannelUpdateLanes[3],
bundledChannelUpdateLanes[5],
],
"bundled-channels-contracts": bundledChannelContractLanes,
openwebui: [],
};
@@ -628,11 +541,6 @@ const legacyReleasePathChunks = {
"plugins-runtime": releasePathPluginRuntimeLanes,
"plugins-integrations": [...releasePathPluginRuntimeLanes, ...releasePathBundledChannelLanes],
"bundled-channels": releasePathBundledChannelLanes,
"bundled-channels-update-a-legacy": [
bundledChannelUpdateLanes[0],
bundledChannelUpdateLanes[1],
bundledChannelUpdateLanes[4],
],
};
function openWebUILane() {