mirror of
https://github.com/openai/codex.git
synced 2026-11-10 00:42:33 +00:00
Preserve thread subscriptions across revert reloads (#38463)
## Why The connection that requested `thread/revert` may close while the thread is being reloaded, but the replacement listener still needs to serve the thread's existing subscriptions. ## What changed Restart the listener task from the preserved thread state after a paginated thread reload instead of attaching it through the requesting connection. GitOrigin-RevId: 603ec3331c59bdde48faa2f4cb0fd1032ec8dbd8
This commit is contained in:
1 parent
535795f7d1
commit
c6dee5f49f
1 file changed
+6
-11
@@ -2064,17 +2064,12 @@ impl ThreadRequestProcessor {
|
|||||||
"rollout path missing after reloading thread {thread_id}"
|
"rollout path missing after reloading thread {thread_id}"
|
||||||
))
|
))
|
||||||
})?;
|
})?;
|
||||||
log_listener_attach_result(
|
// Revert keeps the existing thread state and subscriptions across the internal reload.
|
||||||
self.ensure_conversation_listener(
|
// Start the replacement listener from that state instead of depending on the requesting
|
||||||
thread_id,
|
// connection still being open.
|
||||||
request_id.connection_id,
|
let thread_state = self.thread_state_manager.thread_state(thread_id).await;
|
||||||
/*raw_events_enabled*/ false,
|
self.ensure_listener_task_running(thread_id, Arc::clone(&codex_thread), thread_state)
|
||||||
)
|
.await?;
|
||||||
.await,
|
|
||||||
thread_id,
|
|
||||||
request_id.connection_id,
|
|
||||||
"thread",
|
|
||||||
);
|
|
||||||
let mut thread = self
|
let mut thread = self
|
||||||
.load_thread_from_resume_source_or_send_internal(
|
.load_thread_from_resume_source_or_send_internal(
|
||||||
thread_id,
|
thread_id,
|
||||||
|
|||||||
Reference in new issue
Block a user