mirror of
https://github.com/openai/codex.git
synced 2026-12-01 00:20:48 +00:00
Skip guardian prewarm during active reviews
Only run guardian trunk prewarm when the session can immediately acquire review_lock, and hold that lock through the warmup so a real guardian review cannot race the same session state in parallel. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
Codex
parent
f6e5a25bb4
commit
eb83e6c101
@@ -421,6 +421,10 @@ impl GuardianReviewSessionManager {
|
||||
}
|
||||
};
|
||||
|
||||
let trunk_guard = match trunk.review_lock.try_lock() {
|
||||
Ok(trunk_guard) => trunk_guard,
|
||||
Err(_) => return,
|
||||
};
|
||||
if guardian_request_keeps_prompt_cache_warm(
|
||||
*trunk.last_guardian_request_at.lock().await,
|
||||
tokio::time::Instant::now(),
|
||||
@@ -443,6 +447,7 @@ impl GuardianReviewSessionManager {
|
||||
if prewarm_result.is_ok() {
|
||||
trunk.record_guardian_request(request_at).await;
|
||||
}
|
||||
drop(trunk_guard);
|
||||
trunk
|
||||
.prompt_prewarm_in_flight
|
||||
.store(false, Ordering::Relaxed);
|
||||
|
||||
Reference in New Issue
Block a user