mirror of
https://github.com/openai/codex.git
synced 2026-10-20 00:18:49 +00:00
Avoid cloning events in the app-server thread listener (#55283)
Record whether an event is `ShutdownComplete` before moving it into `apply_bespoke_event_handling`, preserving shutdown drain notification without cloning the event. GitOrigin-RevId: 9e4ca8c657d4d5b98056de8c7aba1391233994c1
This commit is contained in:
@@ -375,8 +375,9 @@ pub(super) async fn ensure_listener_task_running(
|
||||
&outgoing_for_task, conversation_id,
|
||||
).await;
|
||||
}
|
||||
let is_shutdown_complete = matches!(event.msg, EventMsg::ShutdownComplete);
|
||||
apply_bespoke_event_handling(
|
||||
event.clone(),
|
||||
event,
|
||||
conversation_id,
|
||||
conversation.clone(),
|
||||
thread_manager.clone(),
|
||||
@@ -385,7 +386,7 @@ pub(super) async fn ensure_listener_task_running(
|
||||
thread_watch_manager.clone(),
|
||||
)
|
||||
.await;
|
||||
if matches!(event.msg, EventMsg::ShutdownComplete)
|
||||
if is_shutdown_complete
|
||||
&& let Some(completion_tx) = thread_state
|
||||
.lock()
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user