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.
This commit is contained in:
orcunulutas
2026-09-24 17:01:05 +05:30
committed by kshitij
parent 44af0c9faf
commit 27c9d37730

View File

@@ -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