@@ -204,6 +204,19 @@ fn maybe_push_chat_wire_api_deprecation(
204204 } ) ;
205205}
206206
207+ fn session_timestamp_from_history ( initial_history : & InitialHistory ) -> Option < String > {
208+ let items = match initial_history {
209+ InitialHistory :: New => return None ,
210+ InitialHistory :: Resumed ( resumed) => resumed. history . as_slice ( ) ,
211+ InitialHistory :: Forked ( items) => items. as_slice ( ) ,
212+ } ;
213+
214+ items. iter ( ) . find_map ( |item| match item {
215+ RolloutItem :: SessionMeta ( line) => Some ( line. meta . timestamp . clone ( ) ) ,
216+ _ => None ,
217+ } )
218+ }
219+
207220impl Codex {
208221 /// Spawn a new [`Codex`] and initialize the session.
209222 pub async fn spawn (
@@ -597,6 +610,8 @@ impl Session {
597610 anyhow:: Error :: from ( e)
598611 } ) ?;
599612 let rollout_path = rollout_recorder. rollout_path . clone ( ) ;
613+ let session_timestamp = session_timestamp_from_history ( & initial_history)
614+ . or_else ( || rollout_recorder. session_timestamp ( ) ) ;
600615
601616 let mut post_session_configured_events = Vec :: < Event > :: new ( ) ;
602617
@@ -685,6 +700,7 @@ impl Session {
685700 id : INITIAL_SUBMIT_ID . to_owned ( ) ,
686701 msg : EventMsg :: SessionConfigured ( SessionConfiguredEvent {
687702 session_id : conversation_id,
703+ timestamp : session_timestamp,
688704 model : session_configuration. model . clone ( ) ,
689705 model_provider_id : config. model_provider_id . clone ( ) ,
690706 approval_policy : session_configuration. approval_policy . value ( ) ,
0 commit comments