From b6535fb8de59efe1b03e3fc2bdd621433a8a37b1 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 17 Jul 2026 04:14:37 +0100 Subject: [PATCH] fix(release): stop writing retired smoke state --- scripts/e2e/parallels/agent-workspace.ts | 38 ++----------------- scripts/e2e/parallels/npm-update-scripts.ts | 12 ++---- .../parallels-npm-update-smoke.test.ts | 9 ++++- 3 files changed, 15 insertions(+), 44 deletions(-) diff --git a/scripts/e2e/parallels/agent-workspace.ts b/scripts/e2e/parallels/agent-workspace.ts index faf476b5f481..41abdd76c861 100644 --- a/scripts/e2e/parallels/agent-workspace.ts +++ b/scripts/e2e/parallels/agent-workspace.ts @@ -1,22 +1,5 @@ // Agent Workspace script supports OpenClaw repository automation. -interface AgentWorkspaceScriptOptions { - legacySetupState?: boolean; -} - -export function posixAgentWorkspaceScript( - purpose: string, - options: AgentWorkspaceScriptOptions = {}, -): string { - const legacySetupState = - options.legacySetupState === false - ? "" - : `cat > "$workspace/.openclaw/workspace-state.json" <<'STATE_EOF' -{ - "version": 1, - "setupCompletedAt": "2026-01-01T00:00:00.000Z" -} -STATE_EOF -`; +export function posixAgentWorkspaceScript(purpose: string): string { return `set -eu workspace="\${OPENCLAW_WORKSPACE_DIR:-$HOME/.openclaw/workspace}" mkdir -p "$workspace/.openclaw" @@ -26,23 +9,10 @@ cat > "$workspace/IDENTITY.md" <<'IDENTITY_EOF' - Name: OpenClaw - Purpose: ${purpose} IDENTITY_EOF -${legacySetupState}rm -f "$workspace/BOOTSTRAP.md"`; +rm -f "$workspace/BOOTSTRAP.md"`; } -export function windowsAgentWorkspaceScript( - purpose: string, - options: AgentWorkspaceScriptOptions = {}, -): string { - const legacySetupState = - options.legacySetupState === false - ? "" - : `@' -{ - "version": 1, - "setupCompletedAt": "2026-01-01T00:00:00.000Z" -} -'@ | Set-Content -Path (Join-Path $stateDir 'workspace-state.json') -Encoding UTF8 -`; +export function windowsAgentWorkspaceScript(purpose: string): string { return `$workspace = $env:OPENCLAW_WORKSPACE_DIR if (-not $workspace) { $workspace = Join-Path $env:USERPROFILE '.openclaw\\workspace' } $stateDir = Join-Path $workspace '.openclaw' @@ -53,5 +23,5 @@ New-Item -ItemType Directory -Path $stateDir -Force | Out-Null - Name: OpenClaw - Purpose: ${purpose} '@ | Set-Content -Path (Join-Path $workspace 'IDENTITY.md') -Encoding UTF8 -${legacySetupState}Remove-Item (Join-Path $workspace 'BOOTSTRAP.md') -Force -ErrorAction SilentlyContinue`; +Remove-Item (Join-Path $workspace 'BOOTSTRAP.md') -Force -ErrorAction SilentlyContinue`; } diff --git a/scripts/e2e/parallels/npm-update-scripts.ts b/scripts/e2e/parallels/npm-update-scripts.ts index d2e7c708d30a..d36fd142fd81 100644 --- a/scripts/e2e/parallels/npm-update-scripts.ts +++ b/scripts/e2e/parallels/npm-update-scripts.ts @@ -168,9 +168,7 @@ function windowsAssertAgentOkScript(input: NpmUpdateScriptInput): string { ${windowsCodexPlatformPackageRepairFunction()} $sessionPath = Join-Path $env:USERPROFILE '.openclaw\\agents\\main\\sessions\\parallels-npm-update-windows.jsonl' Remove-Item $sessionPath -Force -ErrorAction SilentlyContinue -${windowsAgentWorkspaceScript("Parallels npm update smoke test assistant.", { - legacySetupState: false, -})} +${windowsAgentWorkspaceScript("Parallels npm update smoke test assistant.")} Set-Item -Path ('Env:' + ${psSingleQuote(input.auth.apiKeyEnv)}) -Value ${psSingleQuote(input.auth.apiKeyValue)} $agentOk = $false for ($attempt = 1; $attempt -le 2; $attempt++) { @@ -277,9 +275,7 @@ wait_for_gateway ${posixModelProviderConfigCommands(macosOpenClawCommand, input.auth.modelId, "macos")} "$OPENCLAW_BIN" config set agents.defaults.skipBootstrap true --strict-json "$OPENCLAW_BIN" config set tools.profile minimal -${posixAgentWorkspaceScript("Parallels npm update smoke test assistant.", { - legacySetupState: false, -})} +${posixAgentWorkspaceScript("Parallels npm update smoke test assistant.")} ${posixAssertAgentOkScript(macosOpenClawCommand, input, "macos", "parallels-npm-update-macos")}`; } @@ -419,9 +415,7 @@ openclaw models set ${shellQuote(input.auth.modelId)} ${posixModelProviderConfigCommands("openclaw", input.auth.modelId, "linux")} openclaw config set agents.defaults.skipBootstrap true --strict-json openclaw config set tools.profile minimal -${posixAgentWorkspaceScript("Parallels npm update smoke test assistant.", { - legacySetupState: false, -})} +${posixAgentWorkspaceScript("Parallels npm update smoke test assistant.")} ${posixAssertAgentOkScript("openclaw", input, "linux", "parallels-npm-update-linux")}`; } diff --git a/test/scripts/parallels-npm-update-smoke.test.ts b/test/scripts/parallels-npm-update-smoke.test.ts index 5072601c6b55..44355a04e25a 100644 --- a/test/scripts/parallels-npm-update-smoke.test.ts +++ b/test/scripts/parallels-npm-update-smoke.test.ts @@ -4,6 +4,10 @@ import { tmpdir } from "node:os"; import path from "node:path"; import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion"; import { afterEach, describe, expect, it, vi } from "vitest"; +import { + posixAgentWorkspaceScript, + windowsAgentWorkspaceScript, +} from "../../scripts/e2e/parallels/agent-workspace.ts"; import { runWindowsBackgroundPowerShell } from "../../scripts/e2e/parallels/guest-transports.ts"; import { run as hostCommandRun } from "../../scripts/e2e/parallels/host-command.ts"; import { @@ -271,7 +275,7 @@ exit 1 expect(windowsUpdateScript(input)).toContain(`NPM_CONFIG_REGISTRY = '${registry}'`); }); - it("does not recreate retired workspace setup state after update doctor migration", () => { + it("does not recreate retired workspace setup state in release smoke scripts", () => { const input = { auth: TEST_AUTH, expectedNeedle: "2026.7.2-beta.2", @@ -284,6 +288,9 @@ exit 1 } expect(windowsUpdateScript(input)).toContain("IDENTITY.md"); expect(windowsUpdateScript(input)).not.toContain("workspace-state.json"); + + expect(posixAgentWorkspaceScript("test")).not.toContain("workspace-state.json"); + expect(windowsAgentWorkspaceScript("test")).not.toContain("workspace-state.json"); }); it("accepts keyed and nested npm metadata for published update targets", () => {