Repository navigation
fix(gateway): no 'possible duplicate send' warning on turns with text streaming off (#111281, #110590, salvage #105446) - #111467
Conversation
…icate-send diagnostic Drop the change-detector asserting the default attribute value; the two remaining tests pin the invariants (a delta-fed consumer keeps the WeCom ack-race warning, an interim-only consumer does not).
૮ >ﻌ< ა ci reviewran on 0d95a18 — test(gateway): keep the two invariant tests for the interim-
|
Review: fix(gateway) no duplicate-send warning with text streaming offSummary: Fixes false What changed:
Strengths: Thorough root-cause analysis (live repro table base-vs-head, plus explicit rejection of three alternative gates with reasons). Findings: Two non-blocking polish tips: (1) the test uses Verdict: Looks good to merge. Reviewed using Hermes-Agent |
Gateway turns with text streaming off no longer log a false
possible duplicate sendwarning on every reply.Fixes #111281
Fixes #110590
Fixes #105341
gateway/run_turn_runner.py::_setup_stream_consumerstampsstream_deltas_enabled = want_stream_deltason the consumer it builds: withstreaming.enabled: false(or a per-platform streaming override off) anddisplay.interim_assistant_messageson, the consumer exists only to relay interim commentary and is never fed the final reply's deltas.gateway/run_turn.py::_run_agent_mark_streamed_deliveryskips the DUPLICATE-RISK diagnostic for such consumers; a consumer that was fed deltas (the WeCom ack-race case the warning was written for) still warns.gateway/stream_consumer.py::GatewayStreamConsumercarries the flag (defaultTrue, so the proxy construction site and every streaming-on path keep the diagnostic).tests/gateway/test_interim_only_consumer_warning.py): delta-fed consumer warns; interim-only consumer does not.Live repro:
HERMES_HOME=$(mktemp -d) .venv/bin/python /tmp/batch111/gwdeliver/probe_dup_warning.py <worktree>— builds a REALGatewayStreamConsumerthroughTurnRunner._setup_stream_consumerwithStreamingConfig(enabled=False)+ interim messages on (both reporters' configs), then runs_run_agent_mark_streamed_deliverywith a final that was never streamed.possible duplicate send9326d9cdcStreamingConfig(enabled=True)controlRoot cause: the consumer is constructed whenever
want_stream_deltas or want_interim_messages, but deltas are only tee'd into it whenwant_stream_deltasis true, so theelif _sc is not Nonediagnostic could not tell "consumer built but never fed" from "consumer streamed but lost its delivery confirmation" and warned on both — the constantstreamed=False previewed=False content_delivered=False transformed=Falsefingerprint both reporters measured.Not taken: #107643 (skip when
_accumulated/_message_id/_last_sent_textare empty — reads private consumer state and stays silent for a streamed-then-reset consumer), #110593 (gate on_streamed or _previewed or _content_delivered— those are exactly the conditions under which the earlier branches already suppress, so the warning could never fire), #111296 (gate on_previewedalone — drops the ack-race case withpreviewed=False).Credit
Salvages #105446 by @webtecnica (cherry-picked as-is; the third change-detector test was trimmed). Same symptom reported and analysed in #110590 (@KoNit-K's #110593), #111281 (@kvnloo's #111296) and #107619 (@KoNit-K's #107643).
Infographic