fix(agents): correct completion announce retry backoff schedule
This commit is contained in:
@@ -60,7 +60,10 @@ const ANNOUNCE_EXPIRY_MS = 5 * 60_000; // 5 minutes
|
||||
|
||||
function resolveAnnounceRetryDelayMs(retryCount: number) {
|
||||
const boundedRetryCount = Math.max(0, Math.min(retryCount, 10));
|
||||
const baseDelay = MIN_ANNOUNCE_RETRY_DELAY_MS * 2 ** boundedRetryCount;
|
||||
// retryCount tracks completed failed attempts. The next retry delay should
|
||||
// start at 1s for retry #1, then 2s, 4s, ...
|
||||
const exponent = Math.max(0, boundedRetryCount - 1);
|
||||
const baseDelay = MIN_ANNOUNCE_RETRY_DELAY_MS * 2 ** exponent;
|
||||
return Math.min(baseDelay, MAX_ANNOUNCE_RETRY_DELAY_MS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user