Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
208
scripts/e2e/parallels/plugin-isolation.ts
Normal file
208
scripts/e2e/parallels/plugin-isolation.ts
Normal file
@@ -0,0 +1,208 @@
|
||||
// Plugin Isolation script supports OpenClaw repository automation.
|
||||
import { shellQuote } from "./host-command.ts";
|
||||
import { providerIdFromModelId } from "./provider-auth.ts";
|
||||
|
||||
interface PluginIsolationOptions {
|
||||
fallbackPluginId: string;
|
||||
homeFallback?: string;
|
||||
modelId: string;
|
||||
nodeCommand?: string;
|
||||
}
|
||||
|
||||
export function posixCodexPlatformPackageRepairFunction(): string {
|
||||
return `repair_missing_codex_platform_package() {
|
||||
output_file="$1"
|
||||
grep -F 'Missing optional dependency @openai/codex-' "$output_file" >/dev/null 2>&1 || return 1
|
||||
state_home="\${OPENCLAW_PARALLELS_HOME:-\${HOME:-}}"
|
||||
codex_manifest=""
|
||||
for candidate in "$state_home"/.openclaw/npm/projects/*/node_modules/@openclaw/codex/package.json; do
|
||||
[ -f "$candidate" ] || continue
|
||||
codex_manifest="$candidate"
|
||||
break
|
||||
done
|
||||
if [ -z "$codex_manifest" ]; then
|
||||
echo "codex-platform-repair: managed Codex project not found" >&2
|
||||
return 1
|
||||
fi
|
||||
project_root="\${codex_manifest%/node_modules/@openclaw/codex/package.json}"
|
||||
cache_dir="$(mktemp -d "\${TMPDIR:-/tmp}/openclaw-npm-cache.XXXXXX")"
|
||||
echo "codex-platform-repair: retrying managed npm install once with a fresh cache" >&2
|
||||
repair_rc=0
|
||||
(
|
||||
cd "$project_root"
|
||||
NPM_CONFIG_CACHE="$cache_dir" npm_config_cache="$cache_dir" npm install --omit=dev --omit=peer --legacy-peer-deps --ignore-scripts --no-audit --no-fund
|
||||
) || repair_rc=$?
|
||||
rm -rf "$cache_dir"
|
||||
if [ "$repair_rc" -ne 0 ]; then
|
||||
echo "codex-platform-repair: npm install failed with exit code $repair_rc" >&2
|
||||
return "$repair_rc"
|
||||
fi
|
||||
echo "codex-platform-repair: managed npm install completed" >&2
|
||||
}`;
|
||||
}
|
||||
|
||||
export function windowsCodexPlatformPackageRepairFunction(): string {
|
||||
return String.raw`function Repair-MissingCodexPlatformPackage {
|
||||
param([object[]] $Output)
|
||||
$outputText = $Output | Out-String
|
||||
if ($outputText -notmatch [regex]::Escape('Missing optional dependency @openai/codex-')) {
|
||||
return $false
|
||||
}
|
||||
$projectsRoot = Join-Path $env:USERPROFILE '.openclaw\npm\projects'
|
||||
$codexManifest = Get-ChildItem -Path $projectsRoot -Filter package.json -File -Recurse -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.FullName -match 'node_modules[\\/]@openclaw[\\/]codex[\\/]package\.json$' } |
|
||||
Select-Object -First 1
|
||||
if (-not $codexManifest) {
|
||||
Write-Warning 'codex-platform-repair: managed Codex project not found'
|
||||
return $false
|
||||
}
|
||||
$projectRoot = $codexManifest.Directory.Parent.Parent.Parent.FullName
|
||||
$cacheDir = Join-Path ([System.IO.Path]::GetTempPath()) ('openclaw-npm-cache-' + [guid]::NewGuid().ToString('N'))
|
||||
$oldUpperCache = [Environment]::GetEnvironmentVariable('NPM_CONFIG_CACHE', 'Process')
|
||||
$oldLowerCache = [Environment]::GetEnvironmentVariable('npm_config_cache', 'Process')
|
||||
$pushedLocation = $false
|
||||
$repairExit = 1
|
||||
try {
|
||||
New-Item -ItemType Directory -Path $cacheDir -Force | Out-Null
|
||||
[Environment]::SetEnvironmentVariable('NPM_CONFIG_CACHE', $cacheDir, 'Process')
|
||||
[Environment]::SetEnvironmentVariable('npm_config_cache', $cacheDir, 'Process')
|
||||
Push-Location $projectRoot
|
||||
$pushedLocation = $true
|
||||
Write-Host 'codex-platform-repair: retrying managed npm install once with a fresh cache'
|
||||
$repairOutput = & npm.cmd install --omit=dev --omit=peer --legacy-peer-deps --ignore-scripts --no-audit --no-fund 2>&1
|
||||
$repairExit = $LASTEXITCODE
|
||||
if ($null -ne $repairOutput) { $repairOutput | ForEach-Object { Write-Host $_ } }
|
||||
} finally {
|
||||
if ($pushedLocation) { Pop-Location }
|
||||
[Environment]::SetEnvironmentVariable('NPM_CONFIG_CACHE', $oldUpperCache, 'Process')
|
||||
[Environment]::SetEnvironmentVariable('npm_config_cache', $oldLowerCache, 'Process')
|
||||
Remove-Item $cacheDir -Force -Recurse -ErrorAction SilentlyContinue
|
||||
}
|
||||
if ($repairExit -ne 0) {
|
||||
Write-Warning "codex-platform-repair: npm install failed with exit code $repairExit"
|
||||
return $false
|
||||
}
|
||||
Write-Host 'codex-platform-repair: managed npm install completed'
|
||||
return $true
|
||||
}`;
|
||||
}
|
||||
|
||||
export function providerOnlyPluginId(modelId: string, fallbackPluginId: string): string {
|
||||
return providerIdFromModelId(modelId) || fallbackPluginId;
|
||||
}
|
||||
|
||||
export function posixProviderOnlyPluginIsolationScript(options: PluginIsolationOptions): string {
|
||||
const nodeCommand = shellQuote(options.nodeCommand ?? "node");
|
||||
const homeEnv = options.homeFallback
|
||||
? `OPENCLAW_PARALLELS_HOME=${shellQuote(options.homeFallback)} `
|
||||
: "";
|
||||
return `/usr/bin/env ${homeEnv}${nodeCommand} - <<'JS'
|
||||
${providerOnlyPluginIsolationNodeScript(options)}
|
||||
JS`;
|
||||
}
|
||||
|
||||
export function windowsProviderOnlyPluginIsolationScript(options: PluginIsolationOptions): string {
|
||||
const payloadJson = JSON.stringify({
|
||||
modelId: options.modelId,
|
||||
pluginId: providerOnlyPluginId(options.modelId, options.fallbackPluginId),
|
||||
});
|
||||
return `$env:OPENCLAW_PARALLELS_PLUGIN_ISOLATION = @'
|
||||
${payloadJson}
|
||||
'@
|
||||
$isolationScriptPath = Join-Path ([System.IO.Path]::GetTempPath()) ('openclaw-parallels-plugin-isolation-' + [guid]::NewGuid().ToString('N') + '.cjs')
|
||||
try {
|
||||
@'
|
||||
${providerOnlyPluginIsolationNodeSource()}
|
||||
'@ | Set-Content -Path $isolationScriptPath -Encoding UTF8
|
||||
node.exe $isolationScriptPath
|
||||
if ($LASTEXITCODE -ne 0) { throw "plugin isolation failed with exit code $LASTEXITCODE" }
|
||||
} finally {
|
||||
Remove-Item $isolationScriptPath -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item Env:OPENCLAW_PARALLELS_PLUGIN_ISOLATION -Force -ErrorAction SilentlyContinue
|
||||
}`;
|
||||
}
|
||||
|
||||
function providerOnlyPluginIsolationNodeScript(options: PluginIsolationOptions): string {
|
||||
const payloadJson = JSON.stringify({
|
||||
homeFallback: options.homeFallback,
|
||||
modelId: options.modelId,
|
||||
pluginId: providerOnlyPluginId(options.modelId, options.fallbackPluginId),
|
||||
});
|
||||
return `process.env.OPENCLAW_PARALLELS_PLUGIN_ISOLATION = ${JSON.stringify(payloadJson)};
|
||||
${providerOnlyPluginIsolationNodeSource()}`;
|
||||
}
|
||||
|
||||
function providerOnlyPluginIsolationNodeSource(): string {
|
||||
return String.raw`const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
|
||||
const payload = JSON.parse(process.env.OPENCLAW_PARALLELS_PLUGIN_ISOLATION || "{}");
|
||||
const home =
|
||||
process.env.OPENCLAW_PARALLELS_HOME ||
|
||||
payload.homeFallback ||
|
||||
process.env.HOME ||
|
||||
process.env.USERPROFILE ||
|
||||
"/root";
|
||||
const configPath = path.join(home, ".openclaw", "openclaw.json");
|
||||
const stateDir = path.dirname(configPath);
|
||||
const modelId = String(payload.modelId || "");
|
||||
const allowedPluginId = String(payload.pluginId || "").trim();
|
||||
if (!allowedPluginId || !modelId) {
|
||||
throw new Error("missing plugin isolation payload");
|
||||
}
|
||||
|
||||
const readConfig = () => {
|
||||
if (!fs.existsSync(configPath)) {
|
||||
return {};
|
||||
}
|
||||
return JSON.parse(fs.readFileSync(configPath, "utf8"));
|
||||
};
|
||||
const objectRecord = (value) =>
|
||||
value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
||||
|
||||
const config = readConfig();
|
||||
config.plugins = objectRecord(config.plugins);
|
||||
config.plugins.entries = { [allowedPluginId]: { enabled: true } };
|
||||
config.plugins.allow = [allowedPluginId];
|
||||
|
||||
config.agents = objectRecord(config.agents);
|
||||
config.agents.defaults = objectRecord(config.agents.defaults);
|
||||
config.agents.defaults.model = {
|
||||
...objectRecord(config.agents.defaults.model),
|
||||
primary: modelId,
|
||||
};
|
||||
config.agents.defaults.models = objectRecord(config.agents.defaults.models);
|
||||
const selectedModelEntry = config.agents.defaults.models[modelId];
|
||||
if (selectedModelEntry && typeof selectedModelEntry === "object" && !Array.isArray(selectedModelEntry)) {
|
||||
delete selectedModelEntry.agentRuntime;
|
||||
}
|
||||
|
||||
const providerId = modelId.split("/", 1)[0] || "";
|
||||
const providerModelId = modelId.slice(providerId.length + 1);
|
||||
const providers = objectRecord(objectRecord(config.models).providers);
|
||||
const providerEntry = providers[providerId];
|
||||
if (providerEntry && typeof providerEntry === "object" && !Array.isArray(providerEntry)) {
|
||||
delete providerEntry.agentRuntime;
|
||||
if (Array.isArray(providerEntry.models)) {
|
||||
for (const model of providerEntry.models) {
|
||||
if (
|
||||
model &&
|
||||
typeof model === "object" &&
|
||||
(model.id === providerModelId ||
|
||||
model.id === modelId ||
|
||||
model.name === providerModelId ||
|
||||
model.name === modelId)
|
||||
) {
|
||||
delete model.agentRuntime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fs.rmSync(path.join(stateDir, "npm", "node_modules", "@openclaw", "codex"), {
|
||||
recursive: true,
|
||||
force: true,
|
||||
});
|
||||
fs.mkdirSync(stateDir, { recursive: true });
|
||||
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");`;
|
||||
}
|
||||
Reference in New Issue
Block a user