fix(memory-flush): ban timestamped variant files in default flush prompt (#34951)

Merged via squash.

Prepared head SHA: efadda4988
Co-authored-by: zerone0x <39543393+zerone0x@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
zerone0x
2026-03-06 10:15:13 +08:00
committed by GitHub
parent 8088218f46
commit 94fdee2eac
5 changed files with 27 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { captureFullEnv } from "../../test-utils/env.js";
import type { DaemonActionResponse } from "./response.js";
const loadConfigMock = vi.hoisted(() => vi.fn());
@@ -118,6 +119,7 @@ vi.mock("../../runtime.js", () => ({
}));
const { runDaemonInstall } = await import("./install.js");
const envSnapshot = captureFullEnv();
describe("runDaemonInstall", () => {
beforeEach(() => {
@@ -162,6 +164,12 @@ describe("runDaemonInstall", () => {
isGatewayDaemonRuntimeMock.mockReturnValue(true);
installDaemonServiceAndEmitMock.mockResolvedValue(undefined);
service.isLoaded.mockResolvedValue(false);
delete process.env.OPENCLAW_GATEWAY_TOKEN;
delete process.env.CLAWDBOT_GATEWAY_TOKEN;
});
afterEach(() => {
envSnapshot.restore();
});
it("fails install when token auth requires an unresolved token SecretRef", async () => {