fix(agents): clamp compaction steer retry wait to remaining delivery … · openclaw/openclaw@ea2e9ce
alkor2000
·
2026-05-28
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -286,10 +286,20 @@ async function resolveActiveWakeWithRetries(
|
286 | 286 | } |
287 | 287 | // Use the next scheduled backoff delay; once the schedule is exhausted, |
288 | 288 | // keep using its last entry until the deadline is reached. |
289 | | -const delayMs = |
| 289 | +const scheduledDelayMs = |
290 | 290 | compactionRetryDelaysMs[ |
291 | 291 | Math.min(compactionRetryIndex, compactionRetryDelaysMs.length - 1) |
292 | 292 | ] ?? 0; |
| 293 | +// Clamp the wait to the remaining delivery window so the final retry does |
| 294 | +// not sleep past the deadline (which would overrun the delivery timeout). |
| 295 | +// If no time remains, stop retrying and let the fallback handle it. |
| 296 | +const delayMs = |
| 297 | +compactionDeadlineMs === undefined |
| 298 | + ? scheduledDelayMs |
| 299 | + : Math.min(scheduledDelayMs, compactionDeadlineMs - Date.now()); |
| 300 | +if (delayMs <= 0 && compactionDeadlineMs !== undefined) { |
| 301 | +break; |
| 302 | +} |
293 | 303 | await waitForAnnounceRetryDelay(delayMs, signal); |
294 | 304 | if (signal?.aborted) { |
295 | 305 | break; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。