@@ -86,6 +86,7 @@ export interface HandoffProgress {
8686export class FrameHandoffManager {
8787 private dualStackManager : DualStackManager ;
8888 private activeHandoffs : Map < string , HandoffProgress > = new Map ( ) ;
89+ private handoffMetadata : Map < string , HandoffMetadata > = new Map ( ) ;
8990 private pendingApprovals : Map < string , HandoffApproval [ ] > = new Map ( ) ;
9091 private notifications : Map < string , HandoffNotification [ ] > = new Map ( ) ;
9192
@@ -149,6 +150,7 @@ export class FrameHandoffManager {
149150 } ;
150151
151152 this . activeHandoffs . set ( requestId , progress ) ;
153+ this . handoffMetadata . set ( requestId , metadata ) ;
152154
153155 // Create notifications for relevant stakeholders
154156 await this . createHandoffNotifications ( requestId , metadata , targetUserId ) ;
@@ -567,23 +569,24 @@ export class FrameHandoffManager {
567569 const progress = this . activeHandoffs . get ( requestId ) ;
568570 if ( ! progress ) return ;
569571
570- // Find the original requester (we'll need to enhance this with better metadata tracking)
572+ // Get the original requester from stored handoff metadata
573+ const metadata = this . handoffMetadata . get ( requestId ) ;
574+ const requesterId = metadata ?. initiatorId || 'unknown' ;
571575 const changeRequestNotification : HandoffNotification = {
572576 id : `${ requestId } -changes-${ Date . now ( ) } ` ,
573577 type : 'request' ,
574578 requestId,
575- recipientId : 'requester' , // TODO: Get actual requester from handoff metadata
579+ recipientId : requesterId ,
576580 title : 'Changes Requested for Handoff' ,
577581 message : `${ approval . reviewerId } has requested changes: ${ approval . feedback || 'See detailed suggestions' } ` ,
578582 actionRequired : true ,
579583 expiresAt : new Date ( Date . now ( ) + 48 * 60 * 60 * 1000 ) , // 48 hours
580584 createdAt : new Date ( ) ,
581585 } ;
582586
583- // Store notification (for now using a placeholder recipient)
584- const notifications = this . notifications . get ( 'requester' ) || [ ] ;
587+ const notifications = this . notifications . get ( requesterId ) || [ ] ;
585588 notifications . push ( changeRequestNotification ) ;
586- this . notifications . set ( 'requester' , notifications ) ;
589+ this . notifications . set ( requesterId , notifications ) ;
587590
588591 // Log detailed feedback and suggestions
589592 logger . info ( `Changes requested for handoff: ${ requestId } ` , {
0 commit comments