mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
fix(cron): avoid agent warning for command jobs (#112043)
This commit is contained in:
committed by
GitHub
parent
db482e6e97
commit
be009ee557
@@ -1021,6 +1021,21 @@ describe("cron cli", () => {
|
||||
expectNoRuntimeErrorContaining("No --agent specified");
|
||||
});
|
||||
|
||||
it("does not warn when --command is used (no agent needed)", async () => {
|
||||
await runCronCommand([
|
||||
"cron",
|
||||
"add",
|
||||
"--name",
|
||||
"Command",
|
||||
"--cron",
|
||||
"* * * * *",
|
||||
"--command",
|
||||
"printf ok",
|
||||
]);
|
||||
|
||||
expectNoRuntimeErrorContaining("No --agent specified");
|
||||
});
|
||||
|
||||
it("warns even when --session-key is provided (user should still specify agent explicitly)", async () => {
|
||||
await runCronCommand([
|
||||
"cron",
|
||||
|
||||
@@ -454,9 +454,7 @@ export function registerCronAddCommand(cron: Command) {
|
||||
: undefined;
|
||||
|
||||
if (
|
||||
(resolvedPayload.kind === "agentTurn" ||
|
||||
resolvedPayload.kind === "command" ||
|
||||
resolvedPayload.kind === "script") &&
|
||||
(resolvedPayload.kind === "agentTurn" || resolvedPayload.kind === "script") &&
|
||||
!agentId
|
||||
) {
|
||||
defaultRuntime.error(
|
||||
|
||||
Reference in New Issue
Block a user