Files
hermes-agent/gateway
liuhao1024 d02a254912 fix(gateway): gate sub-floor preamble finalizes on tool boundaries
A segment-break finalize never carries the streaming cursor (the cursor
is only appended to mid-stream frames), so the sub-floor
standalone-message guard's cursor-membership test let every 1-2 token
preamble land as its own durable message at each tool boundary. Each
landing fired on_new_message, resetting the gateway's tool-progress
anchor and fragmenting accumulated tool progress into one persistent
message per tool on draft-streaming platforms (#99026).

Extend the guard to cover segment-break finalizes (finalize and not
is_turn_final). Turn finals stay exempt so a complete short answer is
never swallowed. Update the existing per-segment callback test to use
segment text above the floor, and add draft-mode regression coverage:

- short preamble rounds: no durable sends, no progress resets, drafts
  and the gateway final path unaffected
- full preamble rounds: still one durable send + one reset per segment
  (#17280 chronological-order contract preserved)
- turn-final short answer: always delivered

(cherry picked from commit 5ac896e1f22e6b2164544287c342c7fc7ec2c373)
2026-09-24 22:27:32 +05:30
..
…
…
…