mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-22 19:31:15 +00:00
fix(release): stop writing retired smoke state
This commit is contained in:
@@ -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`;
|
||||
}
|
||||
|
||||
@@ -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")}`;
|
||||
}
|
||||
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user