Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Wait for patch events before reading shell snapshots (#36757)

jifc39d3e99d5dd
diff --git a/codex-rs/core/tests/suite/shell_snapshot.rs b/codex-rs/core/tests/suite/shell_snapshot.rs
index f2f4859940..bd8f86261b 100644
--- a/codex-rs/core/tests/suite/shell_snapshot.rs
+++ b/codex-rs/core/tests/suite/shell_snapshot.rs
@@ -608,10 +608,6 @@ async fn shell_command_snapshot_still_intercepts_apply_patch() -> Result<()> {
})
.await?;
- let snapshot_path = wait_for_snapshot(&codex_home).await?;
- let snapshot_content = fs::read_to_string(&snapshot_path).await?;
- assert_posix_snapshot_sections(&snapshot_content);
-
let mut saw_patch_begin = false;
let mut patch_end = None;
wait_for_event(&codex, |ev| match ev {
@@ -628,6 +624,10 @@ async fn shell_command_snapshot_still_intercepts_apply_patch() -> Result<()> {
})
.await;
+ let snapshot_path = wait_for_snapshot(&codex_home).await?;
+ let snapshot_content = fs::read_to_string(&snapshot_path).await?;
+ assert_posix_snapshot_sections(&snapshot_content);
+
assert!(
saw_patch_begin,
"expected apply_patch to emit PatchApplyBegin"