test(agents): add compaction and workspace reset regressions

This commit is contained in:
Peter Steinberger
2026-02-26 17:40:29 +01:00
parent 0ec7711bc2
commit 53e30475e2
4 changed files with 78 additions and 1 deletions

View File

@@ -76,6 +76,34 @@ describe("onboardCommand", () => {
);
});
it("uses configured default workspace for --reset when --workspace is not provided", async () => {
const runtime = makeRuntime();
mocks.readConfigFileSnapshot.mockResolvedValue({
exists: true,
valid: true,
config: {
agents: {
defaults: {
workspace: "/tmp/openclaw-custom-workspace",
},
},
},
});
await onboardCommand(
{
reset: true,
},
runtime,
);
expect(mocks.handleReset).toHaveBeenCalledWith(
"config+creds+sessions",
"/tmp/openclaw-custom-workspace",
runtime,
);
});
it("accepts explicit --reset-scope full", async () => {
const runtime = makeRuntime();