@@ -661,6 +661,7 @@ pub(crate) async fn apply_bespoke_event_handling(
661661 }
662662 EventMsg :: PlanUpdate ( plan_update_event) => {
663663 handle_turn_plan_update (
664+ conversation_id,
664665 & event_turn_id,
665666 plan_update_event,
666667 api_version,
@@ -693,13 +694,15 @@ async fn handle_turn_diff(
693694}
694695
695696async fn handle_turn_plan_update (
697+ conversation_id : ConversationId ,
696698 event_turn_id : & str ,
697699 plan_update_event : UpdatePlanArgs ,
698700 api_version : ApiVersion ,
699701 outgoing : & OutgoingMessageSender ,
700702) {
701703 if let ApiVersion :: V2 = api_version {
702704 let notification = TurnPlanUpdatedNotification {
705+ thread_id : conversation_id. to_string ( ) ,
703706 turn_id : event_turn_id. to_string ( ) ,
704707 explanation : plan_update_event. explanation ,
705708 plan : plan_update_event
@@ -1422,14 +1425,24 @@ mod tests {
14221425 ] ,
14231426 } ;
14241427
1425- handle_turn_plan_update ( "turn-123" , update, ApiVersion :: V2 , & outgoing) . await ;
1428+ let conversation_id = ConversationId :: new ( ) ;
1429+
1430+ handle_turn_plan_update (
1431+ conversation_id,
1432+ "turn-123" ,
1433+ update,
1434+ ApiVersion :: V2 ,
1435+ & outgoing,
1436+ )
1437+ . await ;
14261438
14271439 let msg = rx
14281440 . recv ( )
14291441 . await
14301442 . ok_or_else ( || anyhow ! ( "should send one notification" ) ) ?;
14311443 match msg {
14321444 OutgoingMessage :: AppServerNotification ( ServerNotification :: TurnPlanUpdated ( n) ) => {
1445+ assert_eq ! ( n. thread_id, conversation_id. to_string( ) ) ;
14331446 assert_eq ! ( n. turn_id, "turn-123" ) ;
14341447 assert_eq ! ( n. explanation. as_deref( ) , Some ( "need plan" ) ) ;
14351448 assert_eq ! ( n. plan. len( ) , 2 ) ;
0 commit comments