mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 23:00:30 +00:00
fix(cron): use separate schema for failureDestination and fix type cast
- Create CronFailureDestinationSchema excluding after/cooldownMs fields - Fix type cast in sendFailureNotificationAnnounce to use CronMessageChannel
This commit is contained in:
committed by
Tak Hoffman
parent
7146ec31da
commit
59d2af8dee
@@ -215,7 +215,7 @@ export async function sendFailureNotificationAnnounce(
|
||||
): Promise<void> {
|
||||
const cfg = loadConfig();
|
||||
const resolvedTarget = await resolveDeliveryTarget(cfg, agentId, {
|
||||
channel: target.channel as "last" | undefined,
|
||||
channel: target.channel as CronMessageChannel | undefined,
|
||||
to: target.to,
|
||||
accountId: target.accountId,
|
||||
});
|
||||
|
||||
@@ -150,11 +150,21 @@ export const CronFailureAlertSchema = Type.Object(
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const CronFailureDestinationSchema = Type.Object(
|
||||
{
|
||||
channel: Type.Optional(Type.Union([Type.Literal("last"), NonEmptyString])),
|
||||
to: Type.Optional(Type.String()),
|
||||
accountId: Type.Optional(NonEmptyString),
|
||||
mode: Type.Optional(Type.Union([Type.Literal("announce"), Type.Literal("webhook")])),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
const CronDeliverySharedProperties = {
|
||||
channel: Type.Optional(Type.Union([Type.Literal("last"), NonEmptyString])),
|
||||
accountId: Type.Optional(NonEmptyString),
|
||||
bestEffort: Type.Optional(Type.Boolean()),
|
||||
failureDestination: Type.Optional(CronFailureAlertSchema),
|
||||
failureDestination: Type.Optional(CronFailureDestinationSchema),
|
||||
};
|
||||
|
||||
const CronDeliveryNoopSchema = Type.Object(
|
||||
|
||||
Reference in New Issue
Block a user