Harden Windows realtime and agent resume tests

Avoid PowerShell command forms that depend on method invocation for the delegated realtime shell-tool test, and wait for a shutdown status before resuming the same subagent thread in the nickname/role restore test.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-05-07 01:52:19 -07:00
parent 59d9e96d66
commit 32deb67fc6
2 changed files with 20 additions and 4 deletions

View File

@@ -2154,10 +2154,10 @@ fn realtime_tool_ok_command() -> Vec<String> {
#[cfg(windows)]
{
vec![
"powershell.exe".to_string(),
"-NoProfile".to_string(),
"-Command".to_string(),
"[Console]::Write('realtime-tool-ok')".to_string(),
"cmd.exe".to_string(),
"/D".to_string(),
"/C".to_string(),
"echo(|set /p dummy=realtime-tool-ok".to_string(),
]
}

View File

@@ -1631,6 +1631,22 @@ async fn resume_thread_subagent_restores_stored_nickname_and_role() {
.shutdown_live_agent(child_thread_id)
.await
.expect("child shutdown should submit");
if !matches!(status_rx.borrow().clone(), AgentStatus::Shutdown) {
timeout(Duration::from_secs(5), async {
loop {
status_rx
.changed()
.await
.expect("child status should reach shutdown");
if matches!(status_rx.borrow().clone(), AgentStatus::Shutdown) {
break;
}
}
})
.await
.expect("child should shut down before resume");
}
drop(child_thread);
let resumed_thread_id = harness
.control