Files
openclaw/src/config/types.cron.ts
Altay 6e962d8b9e fix(agents): handle overloaded failover separately (#38301)
* fix(agents): skip auth-profile failure on overload

* fix(agents): note overload auth-profile fallback fix

* fix(agents): classify overloaded failures separately

* fix(agents): back off before overload failover

* fix(agents): tighten overload probe and backoff state

* fix(agents): persist overloaded cooldown across runs

* fix(agents): tighten overloaded status handling

* test(agents): add overload regression coverage

* fix(agents): restore runner imports after rebase

* test(agents): add overload fallback integration coverage

* fix(agents): harden overloaded failover abort handling

* test(agents): tighten overload classifier coverage

* test(agents): cover all-overloaded fallback exhaustion

* fix(cron): retry overloaded fallback summaries

* fix(cron): treat HTTP 529 as overloaded retry
2026-03-07 01:42:11 +03:00

61 lines
1.9 KiB
TypeScript

import type { SecretInput } from "./types.secrets.js";
/** Error types that can trigger retries for one-shot jobs. */
export type CronRetryOn = "rate_limit" | "overloaded" | "network" | "timeout" | "server_error";
export type CronRetryConfig = {
/** Max retries for transient errors before permanent disable (default: 3). */
maxAttempts?: number;
/** Backoff delays in ms for each retry attempt (default: [30000, 60000, 300000]). */
backoffMs?: number[];
/** Error types to retry; omit to retry all transient types. */
retryOn?: CronRetryOn[];
};
export type CronFailureAlertConfig = {
enabled?: boolean;
after?: number;
cooldownMs?: number;
mode?: "announce" | "webhook";
accountId?: string;
};
export type CronFailureDestinationConfig = {
channel?: string;
to?: string;
accountId?: string;
mode?: "announce" | "webhook";
};
export type CronConfig = {
enabled?: boolean;
store?: string;
maxConcurrentRuns?: number;
/** Override default retry policy for one-shot jobs on transient errors. */
retry?: CronRetryConfig;
/**
* Deprecated legacy fallback webhook URL used only for stored jobs with notify=true.
* Prefer per-job delivery.mode="webhook" with delivery.to.
*/
webhook?: string;
/** Bearer token for cron webhook POST delivery. */
webhookToken?: SecretInput;
/**
* How long to retain completed cron run sessions before automatic pruning.
* Accepts a duration string (e.g. "24h", "7d", "1h30m") or `false` to disable pruning.
* Default: "24h".
*/
sessionRetention?: string | false;
/**
* Run-log pruning controls for `cron/runs/<jobId>.jsonl`.
* Defaults: `maxBytes=2_000_000`, `keepLines=2000`.
*/
runLog?: {
maxBytes?: number | string;
keepLines?: number;
};
failureAlert?: CronFailureAlertConfig;
/** Default destination for failure notifications across all cron jobs. */
failureDestination?: CronFailureDestinationConfig;
};