@@ -72,6 +72,7 @@ use codex_app_server_protocol::ServerNotification;
7272use codex_app_server_protocol:: SessionSource as AppServerSessionSource ;
7373use codex_app_server_protocol:: Thread ;
7474use codex_app_server_protocol:: ThreadExecutionEnvironment ;
75+ use codex_app_server_protocol:: ThreadResumeParams ;
7576use codex_app_server_protocol:: ThreadResumeResponse ;
7677use codex_app_server_protocol:: ThreadStartParams ;
7778use codex_app_server_protocol:: ThreadStartResponse ;
@@ -2192,6 +2193,67 @@ async fn thread_execution_environment_flows_to_thread_turn_and_steer_events() {
21922193 ) ;
21932194 out. clear ( ) ;
21942195
2196+ reducer
2197+ . ingest (
2198+ AnalyticsFact :: ClientRequest {
2199+ connection_id : 7 ,
2200+ request_id : RequestId :: Integer ( 2 ) ,
2201+ request : Box :: new ( ClientRequest :: ThreadResume {
2202+ request_id : RequestId :: Integer ( 2 ) ,
2203+ params : ThreadResumeParams {
2204+ thread_id : "thread-2" . to_string ( ) ,
2205+ ..Default :: default ( )
2206+ } ,
2207+ } ) ,
2208+ } ,
2209+ & mut out,
2210+ )
2211+ . await ;
2212+ reducer
2213+ . ingest (
2214+ AnalyticsFact :: ClientResponse {
2215+ connection_id : 7 ,
2216+ response : Box :: new ( sample_thread_resume_response (
2217+ "thread-2" , /*ephemeral*/ false , "gpt-5" ,
2218+ ) ) ,
2219+ } ,
2220+ & mut out,
2221+ )
2222+ . await ;
2223+
2224+ let resume_payload = serde_json:: to_value ( & out[ 0 ] ) . expect ( "serialize resume thread event" ) ;
2225+ assert_eq ! (
2226+ resume_payload[ "event_params" ] [ "execution_environment" ] ,
2227+ json!( "remote" )
2228+ ) ;
2229+ out. clear ( ) ;
2230+
2231+ reducer
2232+ . ingest (
2233+ AnalyticsFact :: Custom ( CustomAnalyticsFact :: SubAgentThreadStarted (
2234+ SubAgentThreadStartedInput {
2235+ thread_id : "thread-subagent" . to_string ( ) ,
2236+ parent_thread_id : Some ( "thread-2" . to_string ( ) ) ,
2237+ product_client_id : "codex-tui" . to_string ( ) ,
2238+ client_name : "codex-tui" . to_string ( ) ,
2239+ client_version : "1.0.0" . to_string ( ) ,
2240+ model : "gpt-5" . to_string ( ) ,
2241+ ephemeral : false ,
2242+ subagent_source : SubAgentSource :: Review ,
2243+ created_at : 123 ,
2244+ } ,
2245+ ) ) ,
2246+ & mut out,
2247+ )
2248+ . await ;
2249+
2250+ let subagent_payload = serde_json:: to_value ( & out[ 0 ] ) . expect ( "serialize subagent thread event" ) ;
2251+ assert_eq ! (
2252+ subagent_payload[ "event_params" ] [ "execution_environment" ] ,
2253+ json!( "remote" )
2254+ ) ;
2255+ out. clear ( ) ;
2256+
21952257 ingest_turn_prerequisites (
21962258 & mut reducer,
21972259 & mut out,
0 commit comments