@@ -93,6 +93,7 @@ use crate::protocol::ExecCommandBeginEvent;
9393use crate :: protocol:: ExecCommandEndEvent ;
9494use crate :: protocol:: FileChange ;
9595use crate :: protocol:: InputItem ;
96+ use crate :: protocol:: InputMessageKind ;
9697use crate :: protocol:: ListCustomPromptsResponseEvent ;
9798use crate :: protocol:: Op ;
9899use crate :: protocol:: PatchApplyBeginEvent ;
@@ -107,6 +108,7 @@ use crate::protocol::TaskCompleteEvent;
107108use crate :: protocol:: TokenUsage ;
108109use crate :: protocol:: TokenUsageInfo ;
109110use crate :: protocol:: TurnDiffEvent ;
111+ use crate :: protocol:: UserMessageEvent ;
110112use crate :: protocol:: WebSearchBeginEvent ;
111113use crate :: rollout:: RolloutRecorder ;
112114use crate :: rollout:: RolloutRecorderParams ;
@@ -1184,7 +1186,8 @@ async fn submission_loop(
11841186 let mut turn_context = Arc :: new ( turn_context) ;
11851187 // To break out of this loop, send Op::Shutdown.
11861188 while let Ok ( sub) = rx_sub. recv ( ) . await {
1187- debug ! ( ?sub, "Submission" ) ;
1189+ // Avoid logging full submission payloads to prevent leaking prompt or template text.
1190+ debug ! ( "Submission received: id={}" , sub. id) ;
11881191 match sub. op {
11891192 Op :: Interrupt => {
11901193 sess. interrupt_task ( ) ;
@@ -1370,12 +1373,23 @@ async fn submission_loop(
13701373 Op :: AddToHistory { text } => {
13711374 let id = sess. conversation_id ;
13721375 let config = config. clone ( ) ;
1376+ let text_for_history = text. clone ( ) ;
13731377 tokio:: spawn ( async move {
1374- if let Err ( e) = crate :: message_history:: append_entry ( & text, & id, & config) . await
1378+ if let Err ( e) =
1379+ crate :: message_history:: append_entry ( & text_for_history, & id, & config) . await
13751380 {
13761381 warn ! ( "failed to append to message history: {e}" ) ;
13771382 }
13781383 } ) ;
1384+
1385+ // Persist a transcript-only user message in rollout so resume displays
1386+ // exactly what the user saw in the transcript. Do not send to UI to avoid duplicates.
1387+ let rollout_item = RolloutItem :: EventMsg ( EventMsg :: UserMessage ( UserMessageEvent {
1388+ message : text,
1389+ kind : Some ( InputMessageKind :: Plain ) ,
1390+ images : None ,
1391+ } ) ) ;
1392+ sess. persist_rollout_items ( & [ rollout_item] ) . await ;
13791393 }
13801394
13811395 Op :: GetHistoryEntryRequest { offset, log_id } => {
0 commit comments