惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
Y
Y Combinator Blog
博客园_首页
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
宝玉的分享
宝玉的分享
B
Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
WordPress大学
WordPress大学
L
LangChain Blog
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
博客园 - 聂微东
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Help Net Security

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(cron): classify network retry errors (#85344) · openc...
steipete · 2026-05-22 · via Recent Commits to openclaw:main

@@ -2,7 +2,7 @@ import { resolveFailoverReasonFromError } from "../../agents/failover-error.js";

22

import { formatEmbeddedAgentExecutionPhase } from "../../agents/pi-embedded-runner/execution-phase.js";

33

import { readSessionEntry } from "../../config/sessions/store-load.js";

44

import type { SessionEntry } from "../../config/sessions/types.js";

5-

import type { CronConfig, CronRetryOn } from "../../config/types.cron.js";

5+

import type { CronConfig } from "../../config/types.cron.js";

66

import type { HeartbeatRunResult } from "../../infra/heartbeat-wake.js";

77

import {

88

HEARTBEAT_SKIP_CRON_IN_PROGRESS,

@@ -25,6 +25,7 @@ import type { DeliveryContext } from "../../utils/delivery-context.types.js";

2525

import { clearCronJobActive, markCronJobActive } from "../active-jobs.js";

2626

import { resolveCronDeliveryPlan, resolveFailureDestination } from "../delivery-plan.js";

2727

import { resolveCronAgentSessionKey } from "../isolated-agent/session-key.js";

28+

import { resolveCronExecutionRetryHint } from "../retry-hint.js";

2829

import {

2930

createCronRunDiagnosticsFromError,

3031

normalizeCronRunDiagnostics,

@@ -560,28 +561,6 @@ function tryFinishCronTaskRun(

560561

/** Default max retries for one-shot jobs on transient errors (#24355). */

561562

const DEFAULT_MAX_TRANSIENT_RETRIES = 3;

562563563-

const TRANSIENT_PATTERNS: Record<string, RegExp> = {

564-

rate_limit:

565-

/(rate[_ ]limit|too many requests|429|resource has been exhausted|cloudflare|tokens per day)/i,

566-

overloaded:

567-

/\b529\b|\boverloaded(?:_error)?\b|high demand|temporar(?:ily|y) overloaded|capacity exceeded/i,

568-

network: /(network|econnreset|econnrefused|fetch failed|socket)/i,

569-

timeout: /(timeout|etimedout)/i,

570-

server_error: /\b5\d{2}\b/,

571-

};

572-573-

function isTransientCronError(error: string | undefined, retryOn?: CronRetryOn[]): boolean {

574-

if (!error || typeof error !== "string") {

575-

return false;

576-

}

577-

const keys = retryOn?.length ? retryOn : (Object.keys(TRANSIENT_PATTERNS) as CronRetryOn[]);

578-

const classified = resolveFailoverReasonFromError(error);

579-

if (classified && keys.includes(classified as CronRetryOn)) {

580-

return true;

581-

}

582-

return keys.some((k) => TRANSIENT_PATTERNS[k]?.test(error));

583-

}

584-585564

function resolveCronNextRunWithLowerBound(params: {

586565

state: CronServiceState;

587566

job: CronJob;

@@ -970,10 +949,14 @@ export function applyJobResult(

970949

job.state.nextRunAtMs = undefined;

971950

} else if (result.status === "error") {

972951

const retryConfig = resolveRetryConfig(state.deps.cronConfig);

973-

const transient = isTransientCronError(result.error, retryConfig.retryOn);

952+

const retryHint = resolveCronExecutionRetryHint(

953+

result.error,

954+

retryConfig.retryOn,

955+

job.state.lastErrorReason,

956+

);

974957

// consecutiveErrors is always set to ≥1 by the increment block above.

975958

const consecutive = job.state.consecutiveErrors;

976-

if (transient && consecutive <= retryConfig.maxAttempts) {

959+

if (retryHint.retryable && consecutive <= retryConfig.maxAttempts) {

977960

// Schedule retry with backoff (#24355).

978961

const backoff = errorBackoffMs(consecutive, retryConfig.backoffMs);

979962

job.state.nextRunAtMs = result.endedAt + backoff;

@@ -1000,7 +983,8 @@ export function applyJobResult(

1000983

jobName: job.name,

1001984

consecutiveErrors: consecutive,

1002985

error: result.error,

1003-

reason: transient ? "max retries exhausted" : "permanent error",

986+

reason: retryHint.retryable ? "max retries exhausted" : "permanent error",

987+

retryCategory: retryHint.category,

1004988

},

1005989

"cron: disabling one-shot job after error",

1006990

);