Skip to content

Commit daafb2b

Browse files
steipeteampagent
andauthored
1 parent 6e458d8 commit daafb2b

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎src/agents/workspace-sqlite-safety.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
import {
2222
DEFAULT_AGENTS_FILENAME,
2323
DEFAULT_BOOTSTRAP_FILENAME,
24+
DEFAULT_IDENTITY_FILENAME,
2425
ensureAgentWorkspace,
2526
WORKSPACE_VANISHED_ERROR_CODE,
2627
} from "./workspace.js";
@@ -114,6 +115,20 @@ describe("workspace setup-only SQLite safety", () => {
114115
});
115116
});
116117

118+
it("accepts a customized profile with migrated setup-only state", async () => {
119+
const tempDir = await makeTempWorkspace("openclaw-workspace-");
120+
const identityPath = path.join(tempDir, DEFAULT_IDENTITY_FILENAME);
121+
await fs.writeFile(identityPath, "# Existing identity\n");
122+
mergeWorkspaceSetupState(tempDir, {
123+
setupCompletedAt: "2026-07-15T10:01:00.000Z",
124+
});
125+
126+
await expect(
127+
ensureAgentWorkspace({ dir: tempDir, ensureBootstrapFiles: true }),
128+
).resolves.toMatchObject({ dir: tempDir });
129+
await expect(fs.readFile(identityPath, "utf8")).resolves.toBe("# Existing identity\n");
130+
});
131+
117132
it("does not mistake an old generated template for setup-only customization", async () => {
118133
const tempDir = await makeTempWorkspace("openclaw-workspace-");
119134
await fs.writeFile(path.join(tempDir, DEFAULT_AGENTS_FILENAME), "old generated agents\n");

‎src/agents/workspace.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ async function workspaceSetupStateHasSurvivalEvidence(params: {
655655
if (await pathExists(params.bootstrapPath)) {
656656
return true;
657657
}
658-
if (await hasWorkspaceUserContentEvidence(params.dir)) {
658+
if (await workspaceProfileLooksConfigured({ dir: params.dir })) {
659659
return true;
660660
}
661661
const currentState = readCanonicalWorkspaceStateSnapshot(params.dir);

0 commit comments

Comments
 (0)