mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 11:55:47 -06:00
fix(tasks): keep maintenance migration scoped
This commit is contained in:
@@ -270,8 +270,6 @@ describe("tasks commands", () => {
|
||||
|
||||
const sessionsDir = state.sessionsDir("main");
|
||||
const storePath = path.join(sessionsDir, "sessions.json");
|
||||
await state.writeConfig({ session: { store: storePath } });
|
||||
resetConfigRuntimeState();
|
||||
await writeTaskSessionStore(storePath, {
|
||||
[childSessionKey]: {
|
||||
sessionId: "old-run",
|
||||
@@ -335,8 +333,6 @@ describe("tasks commands", () => {
|
||||
it("keeps session registry maintenance preview from importing legacy JSON stores", async () => {
|
||||
await withTaskCommandStateDir(async (state) => {
|
||||
const storePath = path.join(state.sessionsDir("main"), "sessions.json");
|
||||
await state.writeConfig({ session: { store: storePath } });
|
||||
resetConfigRuntimeState();
|
||||
await fs.mkdir(path.dirname(storePath), { recursive: true });
|
||||
await fs.writeFile(
|
||||
storePath,
|
||||
|
||||
@@ -45,7 +45,7 @@ import {
|
||||
import { summarizeTaskRecords } from "../tasks/task-registry.summary.js";
|
||||
import type { TaskNotifyPolicy, TaskRecord } from "../tasks/task-registry.types.js";
|
||||
import {
|
||||
ensureSessionStateMigratedForCommand,
|
||||
ensureExplicitSessionStoreMigratedForCommand,
|
||||
loadExplicitSessionStorePreviewForCommand,
|
||||
} from "./session-state-migration.js";
|
||||
import {
|
||||
@@ -151,12 +151,12 @@ async function runSessionRegistryMaintenance(params: {
|
||||
apply: boolean;
|
||||
}): Promise<SessionRegistryMaintenanceSummary> {
|
||||
const cfg = getRuntimeConfig();
|
||||
if (params.apply) {
|
||||
await ensureSessionStateMigratedForCommand(cfg);
|
||||
}
|
||||
const runningCronJobIds = readRunningCronJobIds();
|
||||
const stores: SessionRegistryMaintenanceStoreSummary[] = [];
|
||||
for (const target of resolveAllAgentSessionStoreTargetsSync(cfg)) {
|
||||
if (params.apply) {
|
||||
await ensureExplicitSessionStoreMigratedForCommand(target.storePath);
|
||||
}
|
||||
const beforeStore = params.apply
|
||||
? loadSessionStore(target.storePath, { skipCache: true })
|
||||
: loadExplicitSessionStorePreviewForCommand(target.storePath);
|
||||
|
||||
Reference in New Issue
Block a user