| ... | @@ -214,20 +214,6 @@ export function threadWokeAt( | ... | @@ -214,20 +214,6 @@ export function threadWokeAt( |
| 214 | return wakeAtMs <= Date.parse(options.now) ? shell.snoozedUntil : null; | 214 | return wakeAtMs <= Date.parse(options.now) ? shell.snoozedUntil : null; |
| 215 | } | 215 | } |
| 216 | | 216 | |
| 217 | /** | | |
| 218 | * A merged/closed change request settles its thread only once the thread has | | |
| 219 | * been idle this long. Without the idle guard the merge signal is permanent: | | |
| 220 | * sending a message to a merged-PR thread would un-settle the row only until | | |
| 221 | * its turn completed, then the still-merged PR would snap it straight back | | |
| 222 | * into the settled tail. An hour keeps the follow-up conversation visible | | |
| 223 | * while it is warm; once the burst goes stale the merge signal settles it | | |
| 224 | * again. Activity timestamps can originate on another device while `now` is | | |
| 225 | * this caller's clock: skew shortens or stretches the window by its size, | | |
| 226 | * the same exposure the inactivity auto-settle already accepts — worst case | | |
| 227 | * is a row changing lists early or late, never lost work. | | |
| 228 | */ | | |
| 229 | export const CHANGE_REQUEST_SETTLE_IDLE_MS = 60 * 60 * 1_000; | | |
| 230 | | | |
| 231 | /** | 217 | /** |
| 232 | * Settled resolution over the server-backed settled lifecycle. Activity | 218 | * Settled resolution over the server-backed settled lifecycle. Activity |
| 233 | * blockers (pending approval/user-input, a live session, an unadjudicated | 219 | * blockers (pending approval/user-input, a live session, an unadjudicated |
| ... | @@ -235,7 +221,7 @@ export const CHANGE_REQUEST_SETTLE_IDLE_MS = 60 * 60 * 1_000; | ... | @@ -235,7 +221,7 @@ export const CHANGE_REQUEST_SETTLE_IDLE_MS = 60 * 60 * 1_000; |
| 235 | * override. Past the blockers, the explicit user override (thread.settle / | 221 | * override. Past the blockers, the explicit user override (thread.settle / |
| 236 | * thread.unsettle commands, projected into settledOverride + settledAt) | 222 | * thread.unsettle commands, projected into settledOverride + settledAt) |
| 237 | * wins in both directions; without one, a thread auto-settles on a | 223 | * wins in both directions; without one, a thread auto-settles on a |
| 238 | * merged/closed PR (once idle) or inactivity past the window. The server | 224 | * merged/closed PR immediately or on inactivity past the window. The server |
| 239 | * un-settles on real activity (user message, session start, approval/ | 225 | * un-settles on real activity (user message, session start, approval/ |
| 240 | * user-input request), so an override never goes stale silently. | 226 | * user-input request), so an override never goes stale silently. |
| 241 | */ | 227 | */ |
| ... | @@ -271,16 +257,7 @@ export function effectiveSettled( | ... | @@ -271,16 +257,7 @@ export function effectiveSettled( |
| 271 | // until real activity clears it server-side. | 257 | // until real activity clears it server-side. |
| 272 | if (shell.settledOverride === "active") return false; | 258 | if (shell.settledOverride === "active") return false; |
| 273 | if (options.changeRequestState === "merged" || options.changeRequestState === "closed") { | 259 | if (options.changeRequestState === "merged" || options.changeRequestState === "closed") { |
| 274 | // Only an idle thread settles on the merge signal: the signal itself | 260 | return true; |
| 275 | // never clears, so without this guard fresh activity (a message sent in | | |
| 276 | // a settled thread) would re-settle the moment its turn completed. | | |
| 277 | const lastActivityAt = threadLastActivityAt(shell); | | |
| 278 | if ( | | |
| 279 | lastActivityAt === null || | | |
| 280 | Date.parse(lastActivityAt) < Date.parse(options.now) - CHANGE_REQUEST_SETTLE_IDLE_MS | | |
| 281 | ) { | | |
| 282 | return true; | | |
| 283 | } | | |
| 284 | } | 261 | } |
| 285 | if (options.autoSettleAfterDays === null) return false; | 262 | if (options.autoSettleAfterDays === null) return false; |
| 286 | | 263 | |