From 7242811de4528727a06b57918842d216f86b5d28 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Wed, 16 Sep 2026 12:14:21 -0700 Subject: [PATCH] fix(test): give the stale-abort atomicity test a display consumer so "hello" counts as delivered test_stale_abort_is_atomic_with_holder_read asserts the post-stale-kill death is a no-retry partial (a single stream_error_cleanup close). Its agent had no stream consumer, so the "hello" delta was never recorded as delivered; with the parent commit a death after undelivered deltas is reclassified as an undelivered failure and retried on a fresh client, which added stream_retry_cleanup + a second attempt's close. The test's premise is "died AFTER tokens were delivered", so register a consumer instead of weakening the new classification. --- tests/agent/test_request_client_reuse_abort_races.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/agent/test_request_client_reuse_abort_races.py b/tests/agent/test_request_client_reuse_abort_races.py index 20a5d9afd2..381ec7104c 100644 --- a/tests/agent/test_request_client_reuse_abort_races.py +++ b/tests/agent/test_request_client_reuse_abort_races.py @@ -205,6 +205,10 @@ def test_stale_abort_is_atomic_with_holder_read(monkeypatch): """ monkeypatch.setenv("HERMES_STREAM_STALE_TIMEOUT", "0.05") agent = _make_agent() + # A display consumer, so "hello" counts as DELIVERED text: the death after + # the stale kill is then a no-retry partial (one stream_error_cleanup close), + # not an undelivered failure that retries on a fresh client. + agent.stream_delta_callback = lambda text: None allow_finish = threading.Event() worker_close_reasons = []