From 7775e6526ac60eddac3744be6a7022049ab67482 Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Tue, 10 Nov 2026 08:23:09 -0800 Subject: [PATCH] test(e2e): fail the codex compaction tests when either turn exits nonzero A first turn that read the secret and then errored could still pass, because the resumed turn could recall the value from the compacted history. Both compaction tests now require each turn to exit 0 --- tests/e2e/codex/test_auto_compaction_e2e.py | 2 ++ tests/e2e/codex/test_real_model_name_e2e.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/e2e/codex/test_auto_compaction_e2e.py b/tests/e2e/codex/test_auto_compaction_e2e.py index 13667c8bd6e..165a0161506 100644 --- a/tests/e2e/codex/test_auto_compaction_e2e.py +++ b/tests/e2e/codex/test_auto_compaction_e2e.py @@ -26,6 +26,7 @@ class TestCodexAutoCompaction: cwd=workspace, compact_after_tokens=COMPACT_AFTER_TOKENS, ) + assert first.exit_code == 0, first assert first.thread_id is not None, first (workspace / "secret.txt").unlink() second: Final = codex.resume( @@ -35,5 +36,6 @@ class TestCodexAutoCompaction: cwd=workspace, compact_after_tokens=COMPACT_AFTER_TOKENS, ) + assert second.exit_code == 0, second assert any(compaction.remote for compaction in codex.compactions(first.thread_id)), (first, second) assert marker in second.answer, second diff --git a/tests/e2e/codex/test_real_model_name_e2e.py b/tests/e2e/codex/test_real_model_name_e2e.py index ab8997ef673..9b9b4c21003 100644 --- a/tests/e2e/codex/test_real_model_name_e2e.py +++ b/tests/e2e/codex/test_real_model_name_e2e.py @@ -42,6 +42,7 @@ class TestCodexUnderTheRealModelName: cwd=workspace, compact_after_tokens=COMPACT_AFTER_TOKENS, ) + assert first.exit_code == 0, first assert first.thread_id is not None, first (workspace / "secret.txt").unlink() second: Final = real_name_codex.resume( @@ -51,5 +52,6 @@ class TestCodexUnderTheRealModelName: cwd=workspace, compact_after_tokens=COMPACT_AFTER_TOKENS, ) + assert second.exit_code == 0, second assert any(compaction.remote for compaction in real_name_codex.compactions(first.thread_id)), (first, second) assert marker in second.answer, second