Skip to content

Commit 4e5bcae

Browse files
committed
fix: prioritize child idle grace retries
1 parent b47a437 commit 4e5bcae

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎dist/server.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,7 @@ var server = async ({ client }, options) => {
23302330
return;
23312331
}
23322332
taskDeferredSessions.add(sessionID);
2333-
scheduleSettledContinuation(sessionID, taskStatus.retryAt != null ? taskStatus.retryAt - Date.now() : TASK_BLOCK_RETRY_MS, scheduled != null);
2333+
scheduleSettledContinuation(sessionID, taskStatus.retryAt != null ? taskStatus.retryAt - Date.now() : TASK_BLOCK_RETRY_MS, scheduled != null || taskStatus.retryAt != null);
23342334
return;
23352335
}
23362336
if (busySessions.has(sessionID))

‎src/server.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,11 +1348,13 @@ const server: Plugin = async ({ client }, options?: Options) => {
13481348
// Always re-arm. A task block is the only deferral that records nothing on the
13491349
// goal, so without a scheduled retry a child that never reports a terminal state
13501350
// silently ends auto-continuation: nothing refreshes live children again and the
1351-
// goal keeps reading active with no stop reason.
1351+
// goal keeps reading active with no stop reason. When a fresh child snapshot adds
1352+
// a shorter idle-grace deadline, replace the older fallback timer so the stale
1353+
// running record is revisited promptly even if a poll was already queued.
13521354
scheduleSettledContinuation(
13531355
sessionID,
13541356
taskStatus.retryAt != null ? taskStatus.retryAt - Date.now() : TASK_BLOCK_RETRY_MS,
1355-
scheduled != null,
1357+
scheduled != null || taskStatus.retryAt != null,
13561358
)
13571359
return
13581360
}

0 commit comments

Comments
 (0)