Skip to content

Commit 7a6cf25

Browse files
committed
fix(agents): increment failed instead of skipped for stale orphaned subagent runs (fixes #90766)
When a stale unended subagent run is detected, increment 'failed' instead of 'skipped' so scheduleOrphanRecovery can retry finalization. Previously the stale branch only incremented 'skipped' and the fire-and-forget Promise.allSettled finalization would silently drop errors. ClawSweeper P2: 'Make stale finalization retry-visible'
1 parent 84d8ba0 commit 7a6cf25

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/agents/subagent-orphan-recovery.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,11 @@ export async function recoverOrphanedSubagentSessions(params: {
256256

257257
// Age out stale runs so long-downtime orphans are retired instead
258258
// of being resurrected past the staleness window.
259+
// Increment `failed` (not `skipped`) so scheduleOrphanRecovery retries
260+
// when finalization yields zero-update or throws; otherwise a stale
261+
// active run can be left without retry-visible accounting.
259262
if (isStaleUnendedSubagentRun(runRecord, now)) {
260-
result.skipped++;
263+
result.failed++;
261264
result.failedRuns.push({
262265
runId,
263266
childSessionKey,

0 commit comments

Comments
 (0)