mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
Wait for Guardian score progress in approval tests (#39007)
## Why Guardian stores a `SecurityRiskScore` before advancing its scored-tool-call counter. Waiting only for the score can therefore let the test continue while the asynchronous sampler is still updating its progress state. ## What changed Wait for `latest_scored_tool_call` to advance before exercising Guardian v2 approval decisions, and reuse the same progress tracker for the subsequent assertions. GitOrigin-RevId: 3d92c9a3ccf52f4f43a2454aac60d2479258c1c8
This commit is contained in:
@@ -464,8 +464,15 @@ max_recent_non_user_entries = 8
|
||||
|
||||
let session_store = ExtensionData::new("session-1");
|
||||
let thread_store = test.codex.thread_extension_data();
|
||||
let score_progress = thread_store
|
||||
.get::<GuardianV2ScoreProgress>()
|
||||
.expect("Guardian v2 should track score progress per thread");
|
||||
tokio::time::timeout(Duration::from_secs(5), async {
|
||||
while thread_store.get::<SecurityRiskScore>().is_none() {
|
||||
while score_progress
|
||||
.latest_scored_tool_call
|
||||
.load(Ordering::Acquire)
|
||||
== 0
|
||||
{
|
||||
tokio::task::yield_now().await;
|
||||
}
|
||||
})
|
||||
@@ -491,9 +498,6 @@ max_recent_non_user_entries = 8
|
||||
Some(ReviewDecision::Approved)
|
||||
);
|
||||
|
||||
let score_progress = thread_store
|
||||
.get::<GuardianV2ScoreProgress>()
|
||||
.expect("Guardian v2 should track score progress per thread");
|
||||
assert_eq!(
|
||||
score_progress
|
||||
.latest_scored_tool_call
|
||||
|
||||
Reference in New Issue
Block a user