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