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
This commit is contained in:
ryan-crabbe-berri 2026-11-10 08:23:09 -08:00
parent 8ce3035901
commit 7775e6526a
2 changed files with 4 additions and 0 deletions

View file

@ -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

View file

@ -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