fix(clients): a thread snoozed until a limit reset stays snoozed until the reset #21520
main fromrefs/pull/21520/head·opened View on GitHubReplacement for #15176, which closed when the original fork was accidentally deleted. GitHub refused to reopen it after the branch was restored in the new fork. The original commit, bcab5be55ab0451a034a0a14891a7555b9f56fa6, is preserved, and current upstream main has been merged to resolve conflicts. Prior review and discussion remain in #15176.
A thread snoozed with Snooze until reset can reappear in the inbox before reset when unrelated projection activity advances runtime.updatedAt. That timestamp records general thread activity, so it does not establish a new failure.
The shared classifier now checks the failed run's stable completedAt against snoozedAt, and threadWokeAt reports that same failure time. Equal timestamps keep the thread snoozed. Legacy session-only shells retain their status timestamp comparison. Conflict resolution preserves upstream's pending subagent request wake behavior. The fix applies to web, desktop, and mobile through packages/client-runtime.
Fixes #15130. The maintainer triage establishes the bug and describes this fix direction.
Verification#
vp test run packages/client-runtime/src/state/threadSnoozed.test.ts: all 34 tests passed. Regression cases cover unrelated activity after a failure, failure completion before/at/after snooze, missing snooze timestamps, and the reported wake time.vp run --filter @t3tools/client-runtime typecheck: passed.vp lint packages/client-runtime/src/state/threadSettled.ts packages/client-runtime/src/state/threadSnoozed.test.ts: passed.vp fmt --check packages/client-runtime/src/state/threadSettled.ts packages/client-runtime/src/state/threadSnoozed.test.ts: passed.
Validation was limited to automated classifier tests and package checks; no live client verification was performed.
— GPT-6.1 via Codex
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
282815b9-5ed3-4cf0-b3f5-09705d2fbd08
📥 Commits
-
Reviewing files that changed from the base of the PR and between 67e05acf817e536d18adaf2125ded8962ea5fbce and 60dc17f0404f6b071fabf5d669d0d81cf7ffaeb7.
📒 Files selected for processing: 2
-
packages/client-runtime/src/state/threadSettled.tspackages/client-runtime/src/state/threadSnoozed.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
The snooze classifier now distinguishes failed-run completion time from runtime projection activity. Wake-time selection uses the qualifying run completion time. Regression tests cover failure timing and missing snooze timestamps.
Changes: Failed-run snooze handling
Layer / File(s) Summary Snooze wake classification and wake time
packages/client-runtime/src/state/threadSettled.ts,packages/client-runtime/src/state/threadSnoozed.test.tsFailed runs wake a snoozed thread only when the runtime is failed and the run completion time is later than the snooze. Legacy session-shaped shells retain an updatedAtcheck.threadWokeAtuses the qualifying run completion time. Tests cover projection activity, completion timing, missing snooze timestamps, and the reported wake time.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
t3dotgg
Merge Risk: ⚪ Minimal · up to
60dc1-
No unresolved issue is identified that would prevent merging after normal checks.
Security architecture risk: ⚪ Minimal · up to
60dc1-
The change corrects wake timing within existing client behavior. The reviewed changes introduce no new externally reachable operation, access-control bypass, credential exposure, or execution authority.
Retained concerns No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- observed — The established downstream effects are thread visibility, wake presentation, and visited-state acknowledgement in existing client flows. The changed selector does not itself issue privileged commands, access secrets, or change thread ownership.
Trust Boundaries and Controls
- observed — The changed functions consume already-materialized shell status and timestamps. The full source delta adds no input channel, identity transition, authorization decision, tool authority, or sensitive sink; the test-helper entrypoint signal does not establish attacker reachability.
Resilience and Maintainability Implications
- observed — An existing compatibility fallback synthesizes terminal completion from updatedAt when latestRunCompletedAt is omitted. Such payloads can retain projection-driven early wakes. Comparing base and head shows that this behavior already existed; it is a residual compatibility limitation, not an introduced security concern. The prevalence of those payloads is unestablished.
-
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly identifies the client fix for threads that remain snoozed until a reset. It is concise and related to the primary change. Description check The description explains the problem, the implementation, scope, linked issue and maintainer triage, verification results, and validation limits. It does not use the template headings for Problem, Cha… Linked Issues check Issue [ #15130] requires a limit-snoozed thread to ignore unrelated projection activity and wake only for a later failure/completion or existing wake conditions.threadSettled.tsnow compares the lat…Out of Scope Changes check The changes are limited to the shared snooze classifier and its focused regression tests. The classifier change implements [ #15130]. The fixture, tests, comments, and helper refactor support that beha…Full details: Description check
-
Explanation
The description explains the problem, the implementation, scope, linked issue and maintainer triage, verification results, and validation limits. It does not use the template headings for Problem, Change, or Scope and approval, but it provides the required information in equivalent sections.
Full details: Linked Issues check
-
Explanation
Issue [
#15130] requires a limit-snoozed thread to ignore unrelated projection activity and wake only for a later failure/completion or existing wake conditions.threadSettled.tsnow compares the latest failed or completed runcompletedAtwithsnoozedAtusing a strict>comparison. It no longer uses runtime projectionupdatedAtfor runtime shells. It retains the legacysession.updatedAtcomparison.threadWokeAtreports the run completion time. Tests cover unrelated activity, equal and later completion times, missing snooze timestamps, and the reported wake time. Existing pending approval, input, and subagent request wake checks remain in the classifier.
Full details: Out of Scope Changes check
-
Explanation
The changes are limited to the shared snooze classifier and its focused regression tests. The classifier change implements [
#15130]. The fixture, tests, comments, and helper refactor support that behavior. No unrelated product behavior or unrelated files appear in the reviewed diff.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Note
Grok responding on behalf of Julius.
Thanks @Absterrg0. This is superseded by #16517, which just merged with the same fix in
threadSettled.ts(the failed run'scompletedAtvssnoozedAt, also used for the Woke time) plus the server projection timestamp fixes. #15130 is closed as fixed, so I'm closing this one.juliusmarminge closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
60dc17fMacroscope's review found this PR approvable — This is a localized client-runtime bug fix that distinguishes genuine post-snooze run failures from unrelated projection activity, while preserving legacy behavior and adding targeted regression coverage. It introduces no schema, deployment, security-sensitive, default, or static-analysis configuration changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).