Skip to content

fix(server): grant woken snoozed threads a fresh auto-settle window - #12525

Closed
maria-rcks wants to merge 1 commit into
pingdotgg:mainfrom
maria-rcks:maria/easy-11788-snooze-grace
Closed

maria-rcks wants to merge 1 commit into
pingdotgg:mainfrom
maria-rcks:maria/easy-11788-snooze-grace

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Expired snoozes could auto-settle on the next sweep because inactivity was measured from before the snooze. The inactivity window now starts at the later of the snooze expiry and the latest user or turn activity.

Fixes #11788.

Blacksmith: 19 policy tests and 57 reactor tests passed, along with server typecheck and scoped lint. The regression test fails before the fix. Provider/client wake behavior remains unverified.

Implemented with opencode/muse-spark-1.3-contributor-free through OpenCode.

Summary by CodeRabbit

  • Bug Fixes
    • Expired snoozed threads now receive a fresh inactivity window after waking.
    • Threads remain unsettled when activity since waking is within the auto-settlement window.
    • Threads that remain inactive beyond the window are settled as expected.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 19, 2026
@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 436097d9-031d-407d-afa4-6d4fb91551ff

📥 Commits

Reviewing files that changed from the base of the PR and between cb3d95c and 9e72c64.

📒 Files selected for processing (2)
  • apps/server/src/orchestration/ThreadSettlementPolicy.test.ts
  • apps/server/src/orchestration/ThreadSettlementPolicy.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The auto-settlement policy now uses an expired snooze’s wake time as activity. Future snoozes remain excluded. Tests verify the three-day inactivity window after wake.

Changes

Snooze-aware auto-settlement

Layer / File(s) Summary
Snooze wake time in settlement policy
apps/server/src/orchestration/ThreadSettlementPolicy.ts, apps/server/src/orchestration/ThreadSettlementPolicy.test.ts
resolveAutoSettlementAt includes expired snooze times in activity selection. Tests verify that recently awakened threads remain unsettled and older awakened threads settle.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #11788 requires protection for woken snoozed threads, a fresh inactivity window, and preservation of the disabled auto-settle state. ThreadSettlementPolicy.ts now uses an expired `snoozedUntil…
Out of Scope Changes check ✅ Passed The changes are limited to auto-settlement policy logic and its automated tests. The policy change directly addresses Issue #11788. The test change verifies the required wake-time behavior. No unrelat…
Description check ✅ Passed The description clearly explains the expired-snooze settlement bug, the fix, the linked issue, and validation performed. It does not use the template headings or include the checklist, but the require…
Title check ✅ Passed The title clearly and concisely describes the primary change: granting woken snoozed threads a fresh auto-settle window.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

@macroscopeapp

macroscopeapp Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9e72c64

Macroscope's review found this PR approvable — This narrowly scoped server bug fix adjusts auto-settlement timing for expired snoozes and includes focused coverage for the changed behavior. Existing future-snooze and explicit wake paths remain unchanged, with no schema, deployment, security, billing, or static-analysis changes.

You can add or adjust custom eligibility rules. Learn more.

sheehanmunim added a commit to munimtechnologies/mtcode that referenced this pull request Sep 19, 2026
…uto-settle window

From pingdotgg#12525 by @maria-rcks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Snoozed threads dissapeared (auto-settled?)

2 participants