From d486ba0c424463ca2c54e142de454a3ea9149902 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Thu, 1 Oct 2026 19:06:40 +0530 Subject: [PATCH] test(agent): drop duplicated back-to-back restart tail and fix test name The tail of test_response_between_restarts_resets_the_bound re-ran the restart_count=0 -> MAX_RETRIES continues -> break sequence that the neighbouring bound test already asserts (with refunds, exit reason and steer checks), so it was a copy-paste duplicate. Remove it. The bound now means "restarts since the last response", not "per turn", so rename test_restart_refunds_are_bounded_per_turn to test_back_to_back_restart_refunds_are_bounded to match. --- tests/agent/test_turn_iteration_prep.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/agent/test_turn_iteration_prep.py b/tests/agent/test_turn_iteration_prep.py index ba7933d015..dc32cdacf7 100644 --- a/tests/agent/test_turn_iteration_prep.py +++ b/tests/agent/test_turn_iteration_prep.py @@ -53,7 +53,7 @@ def test_single_restart_still_reissues_the_iteration(flag): @pytest.mark.parametrize("flag", RESTART_FLAGS) -def test_restart_refunds_are_bounded_per_turn(flag): +def test_back_to_back_restart_refunds_are_bounded(flag): """Re-arming the flag every iteration breaks after ``max_retries`` refunds instead of refunding forever (the turn ends, so the session turn lease is released).""" agent = _agent() @@ -112,7 +112,3 @@ def test_response_between_restarts_resets_the_bound(flag): restart_count = verdict.restart_count assert actions == ["continue"] * (3 * MAX_RETRIES) assert agent.steered == [] - # Back-to-back restarts with no response in between still hit the cap. - for _ in range(MAX_RETRIES): - restart_count = _apply(agent, flag, restart_count).restart_count - assert _apply(agent, flag, restart_count).action == "break"