test(release): retry staged runtime mirror races

This commit is contained in:
Peter Steinberger
2026-04-29 00:01:06 +01:00
parent 78853d9adc
commit 18f65c2d58
4 changed files with 24 additions and 4 deletions

View File

@@ -1485,9 +1485,13 @@ show_gateway_status_compat() {
}
verify_turn() {
local agent_log agent_done agent_runner
agent_log="/tmp/openclaw-parallels-agent-turn.log"
agent_done="/tmp/openclaw-parallels-agent-turn.done"
agent_runner="/tmp/openclaw-parallels-agent-turn.sh"
guest_current_user_exec "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" models set "$MODEL_ID"
guest_current_user_exec "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" config set agents.defaults.skipBootstrap true --strict-json
guest_current_user_sh "$(cat <<EOF
run_logged_guest_current_user_sh "$(cat <<EOF
export PATH=$(shell_quote "$GUEST_EXEC_PATH")
workspace="\${OPENCLAW_WORKSPACE_DIR:-\$HOME/.openclaw/workspace}"
mkdir -p "\$workspace/.openclaw"
@@ -1511,7 +1515,7 @@ exec /usr/bin/env $(shell_quote "$API_KEY_ENV=$API_KEY_VALUE") \
--message $(shell_quote "Reply with exact ASCII text OK only.") \
--json
EOF
)"
)" "$agent_log" "$agent_done" "$TIMEOUT_AGENT_S" "$agent_runner"
}
resolve_dashboard_url() {

View File

@@ -2661,8 +2661,10 @@ async function runAgentTurn(params) {
export function shouldRetryCrossOsAgentTurnError(error) {
const message = error instanceof Error ? error.message : String(error);
return /failed to (?:install|stage) bundled runtime deps|failed to stage bundled runtime deps after/u.test(
message,
return (
/failed to (?:install|stage) bundled runtime deps|failed to stage bundled runtime deps after/u.test(
message,
) || /plugin load failed: .*ENOENT: .*plugin-runtime-deps.*\/dist\//su.test(message)
);
}

View File

@@ -110,6 +110,13 @@ describe("scripts/openclaw-cross-os-release-checks", () => {
new Error("document-extract failed to stage bundled runtime deps after 463ms"),
),
).toBe(true);
expect(
shouldRetryCrossOsAgentTurnError(
new Error(
"PluginLoadFailureError: plugin load failed: qqbot: Error: ENOENT: no such file or directory, open '/tmp/home/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-beta.1/dist/console-DnTGmMkY.js'",
),
),
).toBe(true);
expect(shouldRetryCrossOsAgentTurnError(new Error("Agent output did not contain OK."))).toBe(
false,
);

View File

@@ -54,4 +54,11 @@ describe("Parallels smoke model selection", () => {
expect(script).toContain("deadline=$((SECONDS + TIMEOUT_GATEWAY_S))");
expect(script).toContain("gateway status --deep --require-rpc --timeout 30000");
});
it("runs the macOS agent turn through the logged guest runner", () => {
const script = readFileSync("scripts/e2e/parallels-macos-smoke.sh", "utf8");
expect(script).toContain('agent_log="/tmp/openclaw-parallels-agent-turn.log"');
expect(script).toContain("run_logged_guest_current_user_sh");
});
});