@@ -171,6 +171,10 @@ interface FleetOverlay {
171171 lastWaitStatus ?: WaitJSONStatus ;
172172 /** Report/error already copied into a wait or occupancy payload. */
173173 bodyHanded ?: boolean ;
174+ /** Reply handed to completeAfterInterrupt — the settled follow-up's
175+ * reply, kept on the overlay because an interrupt/close overlay can pin
176+ * the projected status so the session payload alone would hide it. */
177+ report ?: string ;
174178 tombstoned ?: boolean ;
175179 hint ?: string ;
176180 /** Mirror of the session's failure record so it survives eviction. */
@@ -312,9 +316,11 @@ class FleetMailbox {
312316 /**
313317 * The interrupt followup finished. Clear the followup and queued overlays
314318 * so wait projects the settled session, but keep a close/interrupt overlay —
315- * a followup reply must not undo interrupt_agent or close_agent.
319+ * a followup reply must not undo interrupt_agent or close_agent. The reply
320+ * itself lands on the overlay so interrupt/close-pinned lanes still hand it
321+ * to the parent; a session payload report keeps precedence.
316322 */
317- completeAfterInterrupt ( id : string , _report ?: string ) : void {
323+ completeAfterInterrupt ( id : string , report ?: string ) : void {
318324 const existing = this . records . get ( id ) ;
319325 if ( existing === undefined || existing . collected === true ) return ;
320326 let changed = false ;
@@ -326,6 +332,10 @@ class FleetMailbox {
326332 delete existing . forceQueued ;
327333 changed = true ;
328334 }
335+ if ( report !== undefined && report . length > 0 ) {
336+ existing . report = report ;
337+ changed = true ;
338+ }
329339 if ( changed ) this . sessions ?. wake ( ) ;
330340 }
331341
@@ -462,6 +472,11 @@ class FleetMailbox {
462472 ...( overlay . bodyHanded === true ? { bodyHanded : true } : { } ) ,
463473 ...( overlay . tombstoned === true ? { tombstoned : true } : { } ) ,
464474 ...( overlay . hint !== undefined ? { hint : overlay . hint } : { } ) ,
475+ // A tombstone already compacted the payload; the overlay reply goes
476+ // with it so compaction keeps bounding memory.
477+ ...( overlay . tombstoned !== true && overlay . report !== undefined
478+ ? { report : overlay . report }
479+ : { } ) ,
465480 ...( payload ?. report !== undefined ? { report : payload . report } : { } ) ,
466481 ...( payload ?. error !== undefined && status === "failed"
467482 ? { error : payload . error }
0 commit comments