fix(client-runtime): keep a warm thread un-settled despite a merged/closed PR#4309
fix(client-runtime): keep a warm thread un-settled despite a merged/closed PR#4309t3dotgg wants to merge 2 commits into
Conversation
…losed PR Sending a message in a settled thread un-settles it server-side (the decider prepends thread.unsettled on turn.start), but the merged/closed-PR auto-settle signal in effectiveSettled is client-derived and never clears, so the row snapped back into the settled tail the moment the new turn completed. Gate the change-request signal on thread idleness: a merged/closed PR only settles a thread quiet for at least an hour. Fresh activity keeps the follow-up conversation in the active list; once the burst goes stale the merge signal settles it again, matching the decider's activity-clears- overrides model. Web and mobile both partition through the shared effectiveSettled, so this covers both clients. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved Straightforward bug fix with clear intent and limited scope. The change adds an idle-window check (1 hour) before settling threads on PR merge/close signals, preventing a race condition where fresh activity would immediately re-settle. Well-documented and properly tested. You can customize Macroscope's approvability policy. Learn more. |
…le; note clock-skew exposure Codex review follow-ups: assert the strict one-hour boundary (activity exactly an hour old stays warm), assert the same shell re-settles once the follow-up burst goes idle, and document that cross-device clock skew shifts the idle window by its size — the same accepted exposure as the inactivity auto-settle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate ca5b817
Problem
Sending a message in a settled thread should un-settle it. Two of the three settle signals already behaved:
thread.unsettledwhenthread.turn.starthits an overridden thread (decider.ts).threadLastActivityAt.But the merged/closed-PR auto-settle signal in
effectiveSettledis client-derived and never clears. Send a message in a merged-PR thread and the row un-settles only while the queued-turn grace / live-session blockers hold — the moment the turn completes,changeRequestState === "merged"classifies it right back into the settled tail. This also defeats the server's un-settle on explicitly settled threads whose PR is merged: the override clears on send, then the merge signal re-settles the row anyway.Fix
Gate the change-request signal on idleness: a merged/closed PR settles a thread only after it has been quiet for
CHANGE_REQUEST_SETTLE_IDLE_MS(1 hour). Fresh activity — the sent message, its turn starting and completing — keeps the follow-up conversation in the active list; once the burst goes stale, the merge signal settles it again. This mirrors the decider's own "activity clears overrides so the thread can auto-settle again after this burst of work goes stale" model.Web (
SidebarV2.tsx) and mobile (threadListV2.ts) both partition through the sharedeffectiveSettled, so one change covers both clients. No contract or server changes: the VCS status contract carries no merge timestamp, so idle-based gating is the clean option.The explicit Settle action on a warm merged-PR thread still works — a user settle sets
settledOverride, which is checked before the merge signal.Testing
mergedandclosedPR states; an idle one still settles.threadListV2tests pass, lint and typecheck clean.🤖 Generated with Claude Code
Note
Low Risk
Client-only list-partitioning logic in shared
effectiveSettled; no auth, server, or contract changes—worst case is threads appearing in the wrong list briefly.Overview
Merged or closed change requests no longer force a thread into the settled list while it still has recent activity.
effectiveSettlednow requires at leastCHANGE_REQUEST_SETTLE_IDLE_MS(one hour) sincethreadLastActivityAtbefore the merge/closed signal can auto-settle; otherwise the thread stays active.This stops follow-up messages in merged-PR threads from un-settling only until the turn finishes, then snapping back into the settled tail because the PR state never clears. After the burst goes idle past the hour window, auto-settle on merge/closed behaves as before. Explicit Settle and other blockers are unchanged.
Tests cover warm vs idle boundaries (including activity exactly one hour old) and re-settling once the idle window elapses.
Reviewed by Cursor Bugbot for commit ca5b817. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Keep warm threads un-settled on merged/closed PRs until idle for 1 hour
Previously,
effectiveSettledin threadSettled.ts would immediately settle a thread when a change request was merged or closed. Now it only settles if the thread has had no activity in the last 60 minutes (CHANGE_REQUEST_SETTLE_IDLE_MS), preserving threads with recent follow-up activity.Macroscope summarized ca5b817.