Expand description
Redundant full-suite test re-run suppression (#2682): the complement to
verify_gate — it stops the suite running MORE than it needs to.
Why: (bake-off L1 diagnosis) The engineer re-runs the full suite 7-14x per
run as repeated “one final run to confirm” passes, even when no code has
changed since the last clean pass, inflating tcode’s turn count far above
claude-code’s on the same challenge.
What: The pure is_redundant_test_rerun predicate the agent loop consults
(when suppression is enabled) to short-circuit a redundant test re-run with
redundant_run::REDUNDANT_RERUN_MESSAGE instead of spawning the suite.
Test: redundant_run::tests::*.
Redundant full-suite test re-run suppression (#2682).
Why: (bake-off L1 diagnosis) The delegated engineer re-runs the full test
suite 7-14x per run, typically framed as “one final run to confirm”, even
when NO code has changed since the last clean pass. Each redundant re-run
burns a whole turn (and the suite’s wall-clock cost), inflating tcode’s
turn count (~33-49) far above claude-code’s (~15) on the same challenge.
The sibling verify-before-finish gate (#2279) guarantees the suite runs at
LEAST once; this module is its complement — it stops the suite running MORE
than it needs to. Together they bracket the correct behaviour: exactly one
clean full-suite pass after the last code change, no more and no less.
What: [is_redundant_test_rerun] is a pure predicate over a loop’s
transcript. A proposed bash test invocation is redundant iff the most
recent prior test invocation ran the BYTE-IDENTICAL command, already PASSED,
and nothing that could have changed the tree (a write_file/write_files/
edit, or any non-test bash command) has run since. Command identity is
load-bearing (#2804 review): a narrow run passing (cargo test -p a) must
never suppress a broader/different one (cargo test --workspace,
cargo test -p b) that never actually ran, nor may a compile-only
cargo test --no-run suppress the real subsequent run. The predicate reuses
verify_gate’s is_test_command / bash_command_from_call so the two
gates can never drift on what counts as a test invocation. agent_loop::AgentLoop’s
dispatch loop consults it (when suppression is enabled via
AgentLoop::with_redundant_run_suppression) and, on a match, short-circuits
the dispatch with [REDUNDANT_RERUN_MESSAGE] instead of actually spawning
the suite — saving the turn’s wall-clock cost and nudging the model to
proceed to finish.
Test: redundant_run::tests::*, plus
agent_loop::tests::redundant_test_rerun_is_suppressed and
agent_loop::tests::test_rerun_after_edit_is_not_suppressed.
Constants§
- REDUNDANT_
RERUN_ MESSAGE - The
ToolResulttext returned in place of a suppressed redundant re-run.
Functions§
- is_
redundant_ test_ rerun - Whether the pending
bashtest callcurrent_call_idwould be a redundant re-run: the SAME command already passed with nothing changed since. - is_
test_ bash_ call - Whether
callis abashinvocation of a test command — the cheap pre-filterdispatch_allapplies before the fulleris_redundant_test_reruntranscript scan.