mirror of
https://github.com/openai/codex.git
synced 2026-05-24 13:04:29 +00:00
Wait for stale startup prewarm abort before MCP swap
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -350,7 +350,7 @@ impl Session {
|
||||
// The prewarm was built with the stale manager and can hold a read
|
||||
// lock while resolving tools. Abort it before swapping managers so
|
||||
// an MCP refresh cannot block turn startup behind stale work.
|
||||
startup_prewarm.abort();
|
||||
startup_prewarm.abort_and_wait().await;
|
||||
}
|
||||
|
||||
let mut old_manager = {
|
||||
|
||||
@@ -47,8 +47,9 @@ impl SessionStartupPrewarmHandle {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn abort(self) {
|
||||
pub(crate) async fn abort_and_wait(self) {
|
||||
self.task.abort();
|
||||
let _ = self.task.await;
|
||||
}
|
||||
|
||||
async fn resolve(
|
||||
|
||||
Reference in New Issue
Block a user