A thread snoozed after a failed run can immediately become eligible for automatic settlement because V2 treats any failed status as a fresh wake-up.
Compare the failed run's completion timestamp with the snooze timestamp. Older failures, equal timestamps, and missing completion timestamps preserve the snooze; fresh failures and completed work can still wake it.
Validation: 11 focused settlement tests passed, including a regression that failed before the fix. Scoped typecheck and targeted lint passed. Cross-provider review was unavailable after the direct Claude Opus 5 high process failed OAuth authentication (exit 1, no model ran).
Targets the Orchestrator V2 branch in #2829. Implemented and reviewed by GPT-6 Astra in Codex/T3.
Note
Medium Risk
Changes eligibility for automatic thread settlement on snoozed threads, which can affect sidebar lifecycle timing but is scoped to one guard with new regression tests.
Overview
Snoozed Orchestrator V2 threads no longer become auto-settlement candidates just because status is failed. The early-wake path in isAutoSettlementCandidate now treats a failure as waking the thread only when the latest run completed after snooze started (or when there is no snoozedAt). Pre-snooze failures, completion exactly at snooze time, and failed status with no completion timestamp keep the thread parked until snoozedUntil.
Fresh failures after snooze and completion-based early wake are unchanged. Tests in ThreadSettlementService.test.ts lock in those edge cases.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ce9ecd9d1b3a3ffd64d5680cf5270166fba3f6a7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Current-base verification#
Updated to V2 base 26a48b007 at 669f993becd191d19d0e4923cdff47a602ec79f3. Fresh focused regression runs pass (11 tests), along with targeted lint and affected package typechecks. The contribution files remain byte-for-byte identical to the previously reviewed PR head; this update incorporates the current target branch. Earlier verification above is retained with its original scope and limitations. Fresh independent Claude review is unavailable: claude auth status reports signed out. Refreshed by GPT-6 Astra in the Codex harness.
Note
Fix isAutoSettlementCandidate so old failures don't wake snoozed V2 threads#
Changes the failed-run early-wake condition in isAutoSettlementCandidate so a failed snoozed thread only qualifies for auto-settlement when it has no snooze-start timestamp or its latest run completed strictly after that timestamp. Threads completed before or exactly at snooze time remain ineligible. Tests in ThreadSettlementService.test.ts cover the before, coincident, and absent-completion cases.
- Behavioral Change: failed threads with an active snooze and a completion that predates snoozing are no longer auto-settlement candidates; previously they could wake the thread.
Macroscope summarized 669f993.
Approvability#
Verdict: Approved at
60c1f1cMacroscope's review found this PR approvable — This is a narrowly scoped server bug fix that prevents stale failures from waking snoozed threads, with regression tests covering the relevant timestamp cases. The production impact is limited to correcting automatic-settlement candidate filtering, with no schema, configuration, or sensitive-area changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).