fix: box apply_patch test harness futures

This commit is contained in:
Michael Bolin
2026-03-26 08:25:11 -07:00
parent 26c66f3ee1
commit d7e76aebc1
8 changed files with 42 additions and 226 deletions
+9 -3
View File
@@ -792,7 +792,9 @@ impl TestCodexHarness {
}
pub async fn submit(&self, prompt: &str) -> Result<()> {
self.test.submit_turn(prompt).await
// Box the submit-and-wait path so callers do not inline the full turn
// future into their own async state.
Box::pin(self.test.submit_turn(prompt)).await
}
pub async fn submit_with_policy(
@@ -844,13 +846,17 @@ impl TestCodexHarness {
call_id: &str,
output_type: ApplyPatchModelOutput,
) -> String {
// Box the awaited output helpers so callers do not inline request
// capture and response parsing into their own async state.
match output_type {
ApplyPatchModelOutput::Freeform => self.custom_tool_call_output(call_id).await,
ApplyPatchModelOutput::Freeform => {
Box::pin(self.custom_tool_call_output(call_id)).await
}
ApplyPatchModelOutput::Function
| ApplyPatchModelOutput::Shell
| ApplyPatchModelOutput::ShellViaHeredoc
| ApplyPatchModelOutput::ShellCommandViaHeredoc => {
self.function_call_stdout(call_id).await
Box::pin(self.function_call_stdout(call_id)).await
}
}
}