test(gateway): regression for plugin-transformed response after streaming

Adds a test that fails without the gateway fix, exercising the
response_transformed=True branch in _finalize_response: a streamed
response whose final text was modified by a transform_llm_output
plugin hook must be edit_message'd in place (not duplicate-sent),
with already_sent=True so the normal final-send is skipped.

Also drops two minor leftovers from the salvaged PR #29119:

  * accumulated_text property on GatewayStreamConsumer (unused)
  * duplicate _response_transformed=False inside the hook try block
This commit is contained in:
teknium1 2026-05-24 04:08:11 -07:00 committed by Teknium
parent 5cb21e3fb5
commit b9f533af0a
3 changed files with 56 additions and 6 deletions

View file

@ -4047,7 +4047,6 @@ def run_conversation(
model=agent.model,
platform=getattr(agent, "platform", None) or "",
)
_response_transformed = False
for _hook_result in _transform_results:
if isinstance(_hook_result, str) and _hook_result:
final_response = _hook_result