tests: use safe fast windows command in compact remote test

This commit is contained in:
Sayan Sisodiya
2026-02-02 22:18:46 -08:00
parent c065132038
commit 0e844dd88e

View File

@@ -234,9 +234,9 @@ async fn remote_compact_trims_function_call_history_to_fit_context_window() -> R
let trimmed_call_id = "trimmed-call";
let retained_command = "echo retained-shell-output";
let trimmed_command = if cfg!(windows) {
"for ($i=1; $i -le 3000; $i++) { Write-Output $i }"
format!("echo {}", "x".repeat(7_000))
} else {
"yes x | head -n 3000"
"yes x | head -n 3000".to_string()
};
let harness = TestCodexHarness::with_builder(
@@ -301,24 +301,14 @@ async fn remote_compact_trims_function_call_history_to_fit_context_window() -> R
final_output_json_schema: None,
})
.await?;
wait_for_event_with_timeout(
&codex,
|event| matches!(event, EventMsg::TurnComplete(_)),
Duration::from_secs(30),
)
.await;
wait_for_event(&codex, |event| matches!(event, EventMsg::TurnComplete(_))).await;
let compact_mock =
responses::mount_compact_json_once(harness.server(), serde_json::json!({ "output": [] }))
.await;
codex.submit(Op::Compact).await?;
wait_for_event_with_timeout(
&codex,
|event| matches!(event, EventMsg::TurnComplete(_)),
Duration::from_secs(30),
)
.await;
wait_for_event(&codex, |event| matches!(event, EventMsg::TurnComplete(_))).await;
assert!(
response_log