Repository navigation
fix(server): automatically settle empty inactive threads - #15783
Adamulek123 wants to merge 2 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused server bug fix that applies the existing inactivity policy to empty threads using their creation time, while preserving current guards and configuration behavior. Targeted unit and runtime tests verify the settlement decision and persisted shell/projection state. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughEmpty threads now use their creation time as the activity timestamp for automatic settlement. Tests cover threshold conditions and verify that the timestamp persists in the thread projection and shell snapshot. Documentation describes this behavior. ChangesEmpty-thread settlement
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Empty threads now settle automatically based on their creation time, and the docs describe this. No merge-blocking risk was identified. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation 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 3 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
An empty thread never reaches automatic inactivity settlement because its activity timestamps are all null. Such threads stay active indefinitely even when they are older than the configured inactivity window.
Change
Use creation time when the thread has no activity timestamp. The existing inactivity window, pin checks, explicit settlement overrides, disabled configuration, and live-work guards still apply. The persisted settlement timestamp also uses creation time so clients keep stable sorting.
Scope and approval
Replaces only the empty-thread settlement part of #15310. This applies the existing inactivity window to threads with no activity; prior maintainer issue triage or approval is not claimed.
Verification
Integrated main
83b982a85catba32e284ae. The two full affected suites passed 94 tests; server package typecheck, targeted lint and formatting passed. The only merge conflict was a test-layer rename, and the original five-file scope is preserved.Validation on the captured main base
efecd3cf8b:thread.auto-settle, and verifies creation time in both the persisted projection and shell snapshot, with no messages or runs.ThreadSettlementService.test.tscases and the new runtime regression passed. Server typecheck, scoped lint, and formatting passed.Implemented with GPT-6.1 Sol through Codex on Windows, using Effect/Vitest and SQLite.