t3code icon indicating copy to clipboard operation
t3code copied to clipboard

fix(server): settle snoozed threads immediately

Open 0bkevin opened this issue 3 months ago • 2 comments

Settling a snoozed thread persisted the settled override while leaving its snooze active. Because snooze takes precedence in client lifecycle classification, the row stayed in Snoozed until it was woken.

The thread decider now emits thread.unsnoozed alongside thread.settled whenever the thread is snoozed, using the same lifecycle timestamp. This moves the row to Settled immediately, preserves the existing unpin behavior, and lets a repeated settle repair legacy settled-and-snoozed state.

Verification:

  • pnpm exec vp test run apps/server/src/orchestration/decider.settled.test.ts (14 tests)
  • pnpm exec vp test run apps/server/src/orchestration/decider.settled.test.ts apps/server/src/orchestration/decider.snoozed.test.ts (24 tests)
  • pnpm --filter t3 exec tsgo --noEmit
  • targeted lint and format checks for both changed files
  • git diff --check
  • isolated web UI pass: snooze via “In 1 hour,” settle from the Snoozed row, confirm immediate placement under Settled without waking, then reload and confirm persistence

Closes #5377

Made with GPT-5.6 Sol using the Codex harness in T3 Code.


[!NOTE] Low Risk Localized orchestration decider lifecycle behavior with new unit tests; no auth, data migration, or broad API surface changes.

Overview Settling a thread now clears snooze so the row can show as Settled instead of staying under Snoozed when lifecycle classification prefers snooze over settled.

The thread.settle handler in decider.ts builds companion events for anything that would keep the row pinned or snoozed: it still emits thread.unpinned when pinned, and also emits thread.unsnoozed with reason user when snoozedUntil is set. Awake threads still get only thread.settled. Pinned + snoozed threads get settled, unpinned, and unsnoozed in one command.

Tests in decider.settled.test.ts cover snoozed settle, legacy settled-and-still-snoozed repair on repeat settle, and pinned+snoozed combinations.

Reviewed by Cursor Bugbot for commit 5a3fd3286539cb72666b03910ed0e5c00b75bc33. Bugbot is set up for automated code reviews on this repo. Configure here.

[!NOTE]

Fix thread settling to immediately unsnooze snoozed threads

  • When settling a thread, decider.ts now emits thread.unsnoozed (with reason 'user') alongside thread.settled when the thread is snoozed.
  • A pinned thread still emits thread.unpinned; both companion events can now be emitted together in the sequence [thread.settled, ...companions].
  • Behavioral Change: previously, settling a snoozed thread left the snooze state intact; now it is cleared as part of the same operation.

Macroscope summarized 5a3fd32.

0bkevin avatar Aug 05 '26 02:08 0bkevin

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 145679c0-a3da-4a7b-a9de-8d4fd85229c4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • [ ] 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar Aug 05 '26 02:08 coderabbitai[bot]

Approvability

Verdict: Approved a5636e3

Straightforward bug fix that extends the settle command to also clear snoozed state, following the existing pattern for clearing pinned state. The change is small, self-contained, and well-tested.

You can customize Macroscope's approvability policy. Learn more.

macroscopeapp[bot] avatar Aug 05 '26 02:08 macroscopeapp[bot]