@@ -163,32 +163,11 @@ describe("effectiveSettled", () => {
163163 ) . toBe ( true ) ;
164164 } ) ;
165165
166- it ( "does not re-settle a warm thread on the merge signal: a message sent in a settled thread keeps it active until idle" , ( ) => {
167- // The merge signal never clears, so without the idle guard a follow-up
168- // message would un-settle the row only until its turn completed, then
169- // snap straight back into the settled tail.
170- const justActive = makeShell ( { activityAt : "2026-04-09T23:30:00.000Z" } ) ;
171- // The idle gate is strict: activity exactly one hour old is still warm.
172- const boundary = makeShell ( { activityAt : "2026-04-09T23:00:00.000Z" } ) ;
173- const idle = makeShell ( { activityAt : "2026-04-09T22:59:59.999Z" } ) ;
174-
166+ it ( "settles immediately when a change request merges or closes" , ( ) => {
167+ const recentlyActive = makeShell ( { activityAt : "2026-04-09T23:59:59.999Z" } ) ;
175168 for ( const changeRequestState of [ "merged" , "closed" ] as const ) {
176169 expect (
177- effectiveSettled ( justActive , {
178- now : NOW ,
179- autoSettleAfterDays : null ,
180- changeRequestState,
181- } ) ,
182- ) . toBe ( false ) ;
183- expect (
184- effectiveSettled ( boundary , {
185- now : NOW ,
186- autoSettleAfterDays : null ,
187- changeRequestState,
188- } ) ,
189- ) . toBe ( false ) ;
190- expect (
191- effectiveSettled ( idle , {
170+ effectiveSettled ( recentlyActive , {
192171 now : NOW ,
193172 autoSettleAfterDays : null ,
194173 changeRequestState,
@@ -197,14 +176,18 @@ describe("effectiveSettled", () => {
197176 }
198177 } ) ;
199178
200- it ( "re-settles a merged-PR thread once the follow-up burst goes idle" , ( ) => {
201- // Same shell, advancing clock: active while warm, settled again after
202- // the idle window passes — the burst cools and the merge signal wins.
203- const shell = makeShell ( { activityAt : "2026-04-09T23:30:00.000Z" } ) ;
204- const options = { autoSettleAfterDays : null , changeRequestState : "merged" as const } ;
205-
206- expect ( effectiveSettled ( shell , { ...options , now : NOW } ) ) . toBe ( false ) ;
207- expect ( effectiveSettled ( shell , { ...options , now : "2026-04-10T00:30:00.001Z" } ) ) . toBe ( true ) ;
179+ it ( "keeps an explicitly un-settled merged-PR thread active" , ( ) => {
180+ const shell = makeShell ( {
181+ settledOverride : "active" ,
182+ activityAt : "2026-04-09T23:59:59.999Z" ,
183+ } ) ;
184+ expect (
185+ effectiveSettled ( shell , {
186+ now : NOW ,
187+ autoSettleAfterDays : null ,
188+ changeRequestState : "merged" ,
189+ } ) ,
190+ ) . toBe ( false ) ;
208191 } ) ;
209192
210193 it ( "never settles a starting session, even with a settled override" , ( ) => {
0 commit comments