@@ -485,7 +485,9 @@ pub enum ThreadItem {
485485 } ,
486486 Reasoning {
487487 id : String ,
488- text : String ,
488+ summary : Vec < String > ,
489+ #[ serde( default ) ]
490+ content : Vec < String > ,
489491 } ,
490492 CommandExecution {
491493 id : String ,
@@ -544,17 +546,11 @@ impl From<CoreTurnItem> for ThreadItem {
544546 . collect :: < String > ( ) ;
545547 ThreadItem :: AgentMessage { id : agent. id , text }
546548 }
547- CoreTurnItem :: Reasoning ( reasoning) => {
548- let text = if !reasoning. summary_text . is_empty ( ) {
549- reasoning. summary_text . join ( "\n " )
550- } else {
551- reasoning. raw_content . join ( "\n " )
552- } ;
553- ThreadItem :: Reasoning {
554- id : reasoning. id ,
555- text,
556- }
557- }
549+ CoreTurnItem :: Reasoning ( reasoning) => ThreadItem :: Reasoning {
550+ id : reasoning. id ,
551+ summary : reasoning. summary_text ,
552+ content : reasoning. raw_content ,
553+ } ,
558554 CoreTurnItem :: WebSearch ( search) => ThreadItem :: WebSearch {
559555 id : search. id ,
560556 query : search. query ,
@@ -691,16 +687,27 @@ pub struct AgentMessageDeltaNotification {
691687#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , JsonSchema , TS ) ]
692688#[ serde( rename_all = "camelCase" ) ]
693689#[ ts( export_to = "v2/" ) ]
694- pub struct ReasoningDeltaNotification {
690+ pub struct ReasoningSummaryTextDeltaNotification {
695691 pub item_id : String ,
696692 pub delta : String ,
693+ pub summary_index : i64 ,
697694}
698695
699696#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , JsonSchema , TS ) ]
700697#[ serde( rename_all = "camelCase" ) ]
701698#[ ts( export_to = "v2/" ) ]
702699pub struct ReasoningSummaryPartAddedNotification {
703700 pub item_id : String ,
701+ pub summary_index : i64 ,
702+ }
703+
704+ #[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , JsonSchema , TS ) ]
705+ #[ serde( rename_all = "camelCase" ) ]
706+ #[ ts( export_to = "v2/" ) ]
707+ pub struct ReasoningTextDeltaNotification {
708+ pub item_id : String ,
709+ pub delta : String ,
710+ pub content_index : i64 ,
704711}
705712
706713#[ derive( Serialize , Deserialize , Debug , Clone , PartialEq , JsonSchema , TS ) ]
@@ -851,7 +858,8 @@ mod tests {
851858 ThreadItem :: from( reasoning_item) ,
852859 ThreadItem :: Reasoning {
853860 id: "reasoning-1" . to_string( ) ,
854- text: "line one\n line two" . to_string( ) ,
861+ summary: vec![ "line one" . to_string( ) , "line two" . to_string( ) ] ,
862+ content: vec![ ] ,
855863 }
856864 ) ;
857865
0 commit comments