mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 03:15:46 -06:00
refactor: store gateway restart recovery in SQLite (#110014)
* refactor: move restart sentinel state to sqlite * fix: satisfy restart sentinel architecture gates * test: avoid cold startup migration timeout * fix: bound durable restart notice retries * test: type restart notice contention mock * fix: detect legacy restart sentinel before reads * fix: keep delivery attempt result internal * fix: narrow restart sentinel preflight guard
This commit is contained in:
committed by
GitHub
parent
b75b62fb1c
commit
5366b6de81
@@ -207,6 +207,23 @@ describe("ensureConfigReady", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it.each(["restart-sentinel.json", "restart-sentinel.json.doctor-importing"])(
|
||||
"runs doctor flow when lightweight startup detection finds %s",
|
||||
async (relativePath) => {
|
||||
const root = useTempOpenClawHome();
|
||||
writeStateMarker(root, relativePath);
|
||||
|
||||
await runEnsureConfigReady(["status"]);
|
||||
|
||||
expect(loadAndMaybeMigrateDoctorConfigMock).toHaveBeenCalledWith({
|
||||
migrateState: true,
|
||||
migrateLegacyConfig: false,
|
||||
invalidConfigNote: false,
|
||||
observe: false,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
it("runs doctor flow when lightweight startup detection finds a pending SQLite archive", async () => {
|
||||
const root = useTempOpenClawHome();
|
||||
writePendingTaskSidecarArchiveMarker(root);
|
||||
|
||||
@@ -124,6 +124,8 @@ function hasLegacyStateMigrationInputs(): boolean {
|
||||
path.join(stateDir, "agent"),
|
||||
path.join(stateDir, "agents"),
|
||||
path.join(stateDir, "plugins", "installs.json"),
|
||||
path.join(stateDir, "restart-sentinel.json"),
|
||||
path.join(stateDir, "restart-sentinel.json.doctor-importing"),
|
||||
path.join(stateDir, "sessions"),
|
||||
path.join(stateDir, "state", "openclaw.sqlite"),
|
||||
].some(fileOrDirExists) ||
|
||||
|
||||
Reference in New Issue
Block a user