Skip to content

Commit 8973e8d

Browse files
committed
fix: include disabled automations in doctor authority hint
1 parent 6ea8a71 commit 8973e8d

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

‎src/commands/doctor/cron/index.test.ts‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,41 @@ describe("collectLegacyCronStoreHealthFindings", () => {
311311
).resolves.toEqual([]);
312312
});
313313

314+
it("includes disabled authority debt in the remediation inventory", async () => {
315+
const storePath = await makeTempStorePath();
316+
const legacyAuthorityJob = {
317+
owner: { agentId: "main", sessionKey: "agent:main:discord:group:ops" },
318+
payload: { kind: "agentTurn", message: "run", toolsAllow: ["write"] },
319+
};
320+
await writeCurrentCronStore(storePath, [
321+
createCurrentCronJob({
322+
...legacyAuthorityJob,
323+
id: "legacy-authority-enabled",
324+
name: "Enabled authority debt",
325+
}),
326+
createCurrentCronJob({
327+
...legacyAuthorityJob,
328+
id: "legacy-authority-disabled",
329+
name: "Disabled authority debt",
330+
enabled: false,
331+
}),
332+
]);
333+
334+
const findings = await collectLegacyCronStoreHealthFindings({
335+
cfg: createCronConfig(storePath),
336+
});
337+
const finding = findings.find(
338+
({ requirement }) => requirement === "cron-scheduled-authority-reauthorization",
339+
);
340+
341+
expect(finding).toEqual(
342+
expect.objectContaining({
343+
message: "2 tool-bearing automations require explicit scheduled authority reauthorization.",
344+
fixHint: expect.stringContaining("openclaw automations list --all"),
345+
}),
346+
);
347+
});
348+
314349
it("reports a legacy quarantine sidecar without creating or modifying a SQLite database", async () => {
315350
const storePath = await makeTempStorePath();
316351
vi.stubEnv("OPENCLAW_STATE_DIR", path.dirname(path.dirname(storePath)));

‎src/commands/doctor/cron/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export async function collectLegacyCronStoreHealthFindings(params: {
299299
message: `${pluralize(names.length, "tool-bearing automation")} ${description}.`,
300300
path: sqliteStorePath,
301301
requirement,
302-
fixHint: `Review with ${formatCliCommand("openclaw automations list")} and reauthorize with ${formatCliCommand("openclaw automations edit <id> --tools <tool,...>")}.`,
302+
fixHint: `Review with ${formatCliCommand("openclaw automations list --all")} and reauthorize with ${formatCliCommand("openclaw automations edit <id> --tools <tool,...>")}.`,
303303
}),
304304
);
305305
}

0 commit comments

Comments
 (0)