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.
This commit is contained in:
teknium1
2026-09-16 12:14:21 -07:00
committed by Teknium
parent 96f313590c
commit 7242811de4

View File

@@ -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 = []