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

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
博客园 - 司徒正美
J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
D
Docker
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
腾讯CDC
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
M
MIT News - Artificial intelligence
Jina AI
Jina AI
I
InfoQ
雷峰网
雷峰网
The Cloudflare Blog
美团技术团队
Engineering at Meta
Engineering at Meta

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: recover stalled embedded diagnostic runs · openclaw/...
steipete · 2026-05-04 · via Recent Commits to openclaw:main

@@ -54,6 +54,8 @@ const webhookStats = {

5454

const DEFAULT_STUCK_SESSION_WARN_MS = 120_000;

5555

const MIN_STUCK_SESSION_WARN_MS = 1_000;

5656

const MAX_STUCK_SESSION_WARN_MS = 24 * 60 * 60 * 1000;

57+

const MIN_STALLED_EMBEDDED_RUN_ABORT_MS = 10 * 60_000;

58+

const STALLED_EMBEDDED_RUN_ABORT_WARN_MULTIPLIER = 5;

5759

const RECENT_DIAGNOSTIC_ACTIVITY_MS = 120_000;

5860

const DEFAULT_LIVENESS_EVENT_LOOP_DELAY_WARN_MS = 1_000;

5961

const DEFAULT_LIVENESS_EVENT_LOOP_UTILIZATION_WARN = 0.95;

@@ -82,6 +84,7 @@ type RecoverStuckSession = (params: {

8284

sessionKey?: string;

8385

ageMs: number;

8486

queueDepth?: number;

87+

allowActiveAbort?: boolean;

8588

}) => void | Promise<void>;

86898790

type DiagnosticLivenessSample = {

@@ -125,6 +128,7 @@ function recoverStuckSession(params: {

125128

sessionKey?: string;

126129

ageMs: number;

127130

queueDepth?: number;

131+

allowActiveAbort?: boolean;

128132

}) {

129133

stuckSessionRecoveryRuntimePromise ??= import("./diagnostic-stuck-session-recovery.runtime.js");

130134

void stuckSessionRecoveryRuntimePromise

@@ -344,6 +348,26 @@ export function resolveStuckSessionWarnMs(config?: OpenClawConfig): number {

344348

return rounded;

345349

}

346350351+

function resolveStalledEmbeddedRunAbortMs(stuckSessionWarnMs: number): number {

352+

return Math.max(

353+

MIN_STALLED_EMBEDDED_RUN_ABORT_MS,

354+

stuckSessionWarnMs * STALLED_EMBEDDED_RUN_ABORT_WARN_MULTIPLIER,

355+

);

356+

}

357+358+

function isStalledEmbeddedRunRecoveryEligible(params: {

359+

classification: SessionAttentionClassification | undefined;

360+

ageMs: number;

361+

stuckSessionWarnMs: number;

362+

}): boolean {

363+

return (

364+

params.classification?.eventType === "session.stalled" &&

365+

params.classification.classification === "stalled_agent_run" &&

366+

params.classification.activeWorkKind === "embedded_run" &&

367+

params.ageMs >= resolveStalledEmbeddedRunAbortMs(params.stuckSessionWarnMs)

368+

);

369+

}

370+347371

export function logWebhookReceived(params: {

348372

channel: string;

349373

updateType?: string;

@@ -594,6 +618,13 @@ export function logSessionAttention(

594618

activity,

595619

staleMs: params.thresholdMs,

596620

});

621+

const recoveryEligible =

622+

classification.recoveryEligible ||

623+

isStalledEmbeddedRunRecoveryEligible({

624+

classification,

625+

ageMs: params.ageMs,

626+

stuckSessionWarnMs: params.thresholdMs,

627+

});

597628

if (classification.eventType === "session.stuck") {

598629

const nextWarnAgeMs =

599630

state.lastStuckWarnAgeMs === undefined

@@ -617,7 +648,7 @@ export function logSessionAttention(

617648

state.queueDepth

618649

} reason=${classification.reason} classification=${classification.classification}${

619650

classification.activeWorkKind ? ` activeWorkKind=${classification.activeWorkKind}` : ""

620-

} recovery=${classification.recoveryEligible ? "checking" : "none"}`,

651+

} recovery=${recoveryEligible ? "checking" : "none"}`,

621652

);

622653

const baseEvent = {

623654

sessionId: state.sessionId,

@@ -816,6 +847,20 @@ export function startDiagnosticHeartbeat(

816847

ageMs,

817848

queueDepth: state.queueDepth,

818849

});

850+

} else if (

851+

isStalledEmbeddedRunRecoveryEligible({

852+

classification,

853+

ageMs,

854+

stuckSessionWarnMs,

855+

})

856+

) {

857+

void (opts?.recoverStuckSession ?? recoverStuckSession)({

858+

sessionId: state.sessionId,

859+

sessionKey: state.sessionKey,

860+

ageMs,

861+

queueDepth: state.queueDepth,

862+

allowActiveAbort: true,

863+

});

819864

}

820865

}

821866

}