mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-23 18:11:15 +00:00
refactor(diagnostics): unify recovery requests (#108736)
This commit is contained in:
committed by
GitHub
parent
fcd2a784f4
commit
ee6ff936ff
@@ -1332,47 +1332,36 @@ export function startDiagnosticHeartbeat(
|
||||
thresholdMs: stuckSessionWarnMs,
|
||||
abortThresholdMs: stuckSessionAbortMs,
|
||||
});
|
||||
if (classification?.recoveryEligible && !shouldDeferRecovery) {
|
||||
requestStuckSessionRecovery({
|
||||
recover: opts?.recoverStuckSession ?? recoverStuckSession,
|
||||
classification,
|
||||
request: {
|
||||
sessionId: state.sessionId,
|
||||
sessionKey: state.sessionKey,
|
||||
sessionFile: state.sessionFile,
|
||||
ageMs: attentionAgeMs,
|
||||
queueDepth: state.queueDepth,
|
||||
expectedState: state.state,
|
||||
stateGeneration: state.generation,
|
||||
staleActiveProgressAbortMs: stuckSessionAbortMs,
|
||||
compactionSafetyTimeoutMs,
|
||||
},
|
||||
});
|
||||
} else if (
|
||||
classification &&
|
||||
!shouldDeferRecovery &&
|
||||
if (!classification || shouldDeferRecovery) {
|
||||
continue;
|
||||
}
|
||||
const activeAbortEligible =
|
||||
!classification.recoveryEligible &&
|
||||
isActiveAbortRecoveryEligible({
|
||||
classification,
|
||||
activity,
|
||||
stuckSessionAbortMs,
|
||||
})
|
||||
) {
|
||||
requestStuckSessionRecovery({
|
||||
recover: opts?.recoverStuckSession ?? recoverStuckSession,
|
||||
classification,
|
||||
request: {
|
||||
sessionId: state.sessionId,
|
||||
sessionKey: state.sessionKey,
|
||||
sessionFile: state.sessionFile,
|
||||
ageMs: attentionAgeMs,
|
||||
queueDepth: state.queueDepth,
|
||||
allowActiveAbort: true,
|
||||
expectedState: state.state,
|
||||
stateGeneration: state.generation,
|
||||
compactionSafetyTimeoutMs,
|
||||
},
|
||||
});
|
||||
if (!classification.recoveryEligible && !activeAbortEligible) {
|
||||
continue;
|
||||
}
|
||||
requestStuckSessionRecovery({
|
||||
recover: opts?.recoverStuckSession ?? recoverStuckSession,
|
||||
classification,
|
||||
request: {
|
||||
sessionId: state.sessionId,
|
||||
sessionKey: state.sessionKey,
|
||||
sessionFile: state.sessionFile,
|
||||
ageMs: attentionAgeMs,
|
||||
queueDepth: state.queueDepth,
|
||||
expectedState: state.state,
|
||||
stateGeneration: state.generation,
|
||||
...(activeAbortEligible
|
||||
? { allowActiveAbort: true }
|
||||
: { staleActiveProgressAbortMs: stuckSessionAbortMs }),
|
||||
compactionSafetyTimeoutMs,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}, DIAGNOSTIC_HEARTBEAT_INTERVAL_MS);
|
||||
|
||||
Reference in New Issue
Block a user