@@ -123,7 +123,7 @@ export function createInboxReturnTracker() {
123123 const keyOf = ( thread : ThreadKeyInput ) => `${ thread . environmentId } :${ thread . id } ` ;
124124 const states = new Map <
125125 string ,
126- { working : boolean ; deadline : number | null ; placement : string }
126+ { working : boolean ; deadline : number | null ; placement : string | null }
127127 > ( ) ;
128128 const returns = new Map < string , number > ( ) ;
129129 const listeners = new Set < ( ) => void > ( ) ;
@@ -184,17 +184,21 @@ export function createInboxReturnTracker() {
184184 for ( const thread of threads ) {
185185 const key = keyOf ( thread ) ;
186186 present . add ( key ) ;
187- const placement = JSON . stringify ( [
188- thread . archivedAt ,
189- thread . deletedAt ,
190- thread . pinnedAt ,
191- thread . settledOverride ,
192- thread . settledAt ,
193- thread . snoozedAt ,
194- thread . snoozedUntil ,
195- thread . activeOrderKey ,
196- ] ) ;
197187 const previous = states . get ( key ) ;
188+ const actual = isThreadWorking ( thread ) ;
189+ const placement =
190+ actual || previous ?. working
191+ ? JSON . stringify ( [
192+ thread . archivedAt ,
193+ thread . deletedAt ,
194+ thread . pinnedAt ,
195+ thread . settledOverride ,
196+ thread . settledAt ,
197+ thread . snoozedAt ,
198+ thread . snoozedUntil ,
199+ thread . activeOrderKey ,
200+ ] )
201+ : null ;
198202 const actionable =
199203 thread . hasPendingApprovals ||
200204 thread . hasPendingUserInput ||
@@ -210,7 +214,6 @@ export function createInboxReturnTracker() {
210214 thread . pinnedAt != null ||
211215 thread . settledOverride === "settled" ||
212216 effectiveSnoozed ( thread , { now : observedAt } ) ;
213- const actual = isThreadWorking ( thread ) ;
214217 // Only shelf placement is held: execution state and attention requests stay authoritative.
215218 const deadline =
216219 ! actual && previous ?. working && ! actionable && ! moved && ! excluded
0 commit comments