fix(threads): keep un-settled threads active after their PR merges - #61
Merged
Merged
Conversation
Un-settling a thread whose PR had merged only lasted minutes: any session start or message cleared the keep-active pin back to neutral, and the merged-PR rule then re-settled the thread the moment the burst of work went quiet (the reaper ending the idle session was usually the trigger). The thread read as "done" while follow-up work was still happening in its worktree. Two changes, both preserving the intended lifecycle: - The explicit keep-active pin is now sticky: activity still wakes an explicitly SETTLED thread (blocked work must never stay hidden), but no longer spends the user's "not done" pin. Only an explicit settle clears it. (decider.ts, three sites) - Instant merged/closed-PR auto-settle now applies only when the thread went quiet at or before the PR's completion. Activity newer than the PR's updatedAt defers to the ordinary inactivity rule instead. The PR's updatedAt (already fetched from gh) now rides the VCS status contract into web and mobile classification. Absent timestamp (older servers) keeps the original instant behavior. Upstream context: pingdotgg#5575 describes the sticky-pin gap; pingdotgg#5643 proposes a toggle plus sticky un-settle. The post-merge-activity gate here fixes the default path without a setting. Registered in SEAM.md as an upstream candidate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Un-settling a thread whose PR has merged only sticks for minutes. Repro (observed on worktree
t3code-767f58a0, PR #54 merged):settledOverride: "active").The thread reads as "done" while follow-up work is still happening in its worktree, and every un-settle buys only one burst of work.
The fix (two parts, intended behavior preserved)
1. Sticky keep-active pin (server,
decider.ts, 3 sites). Activity still wakes an explicitly settled thread — blocked work must never stay hidden, that direction is untouched. But activity no longer spends the user's explicit "not done" pin. Only an explicit settle clears it.2. Post-merge-activity gate (client,
threadSettled.ts). Instant merged/closed-PR auto-settle now applies only when the thread went quiet at or before the PR's completion. Activity newer than the PR'supdatedAtdefers to the ordinary inactivity rule. To feed this, the PR'supdatedAt(already fetched from gh, previously dropped) now ridesVcsStatusChangeRequestinto the web and mobile classifications. When the timestamp is absent (older servers), behavior is unchanged.The common case is untouched: a thread that goes quiet when its PR merges still settles immediately.
Upstream context
SEAM.mdas an upstream candidate; prefer upstream's version wholesale if they merge an equivalent.Tests
effectiveSettledpost-merge gate coverage (fresh/stale/quiet/absent-timestamp × merged/closed); GitManagerupdatedAtforwarding.🤖 Generated with Claude Code