From 27c9d377304ddfe941d2bdfa9fc6cc7c3fe16896 Mon Sep 17 00:00:00 2001 From: orcunulutas <4663659+orcunulutas@users.noreply.github.com> Date: Thu, 24 Sep 2026 17:01:05 +0530 Subject: [PATCH] fix(tui_gateway): forward response_transformed on turn completion (#96465) Gateway half of #96467 (7eeb0d4b03), grafted from server.py::_run_prompt_submit into tui_gateway/prompt_turn.py::_complete_turn_payload. Renderer half pending (conflicts with main's use-message-stream). Original commit email unusable; authored with the contributor's noreply address. --- tui_gateway/prompt_turn.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tui_gateway/prompt_turn.py b/tui_gateway/prompt_turn.py index 32cad0497e..035449e2c7 100644 --- a/tui_gateway/prompt_turn.py +++ b/tui_gateway/prompt_turn.py @@ -830,6 +830,10 @@ def _complete_turn_payload(session: dict, st: _TurnRun, status_note: str | None, payload["warning"] = status_note if result.get("response_previewed"): payload["response_previewed"] = True + # transform_llm_output may rewrite the final after streaming: the renderer must treat + # this payload as the authoritative replacement even without a prefix relationship. + if result.get("response_transformed"): + payload["response_transformed"] = True # Structured billing-wall descriptor: the client renders recovery without re-parsing text. if _billing_block := result.get("billing_block"): payload["billing"] = _billing_block