diff --git a/conditioning.py b/conditioning.py index 8e8e7d8a..dfa3b2a9 100644 --- a/conditioning.py +++ b/conditioning.py @@ -10787,11 +10787,13 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner): thinking=prompt_enhance_thinking, image=prompt_enhance_image, **_enhance_sampling, ) + _chat_sent = self._v2_enhancer_chat(prompt_enhance_chat) print(f"[FunPackVideoRefinerV2] {_enhance_status}") self._v2_note_enhanced({ "scene": None, "before": _before, "after": prompt_to_encode, "status": _enhance_status, "image": prompt_enhance_image is not None, - "reference": _ref.strip(), "thinking": self._v2_last_thinking}) + "reference": _ref.strip(), "chat": _chat_sent.strip(), + "thinking": self._v2_last_thinking}) # Studio's `enhanced_prompt` output, for a node encoding on its own (Editor link # "Enhanced prompt, fallback to prompt + postfix"). The same text that link's @@ -10812,6 +10814,7 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner): self._v2_note_enhanced({ "scene": None, "before": _whole, "after": _after, "status": _st, "image": prompt_enhance_image is not None, "reference": _ref.strip(), + "chat": self._v2_enhancer_chat(prompt_enhance_chat).strip(), "thinking": self._v2_last_thinking}) _whole = _after self._v2_enhanced_output = _whole @@ -11066,7 +11069,9 @@ class FunPackVideoRefinerV2(FunPackVideoRefiner): self._v2_note_enhanced({ "scene": _i, "before": t, "after": _after, "status": _st, "image": prompt_enhance_image is not None, - "reference": _ref.strip(), "thinking": self._v2_last_thinking}) + "reference": _ref.strip(), + "chat": self._v2_enhancer_chat(prompt_enhance_chat, _i).strip(), + "thinking": self._v2_last_thinking}) _enhanced_texts.append(_after) split_scene_texts = _enhanced_texts scene_refinement_keys = [set(s.get("keys") or set()) for s in canon_scenes] diff --git a/movie_editor/frontend/composer.js b/movie_editor/frontend/composer.js index 79b18b58..4008bd9d 100644 --- a/movie_editor/frontend/composer.js +++ b/movie_editor/frontend/composer.js @@ -1077,6 +1077,13 @@ el("div", "enh-before-text enh-ref-sent", ref)); card.append(det); } + // The Chat tab's conversation exactly as the model received it (empty = none sent). + const chat = String(it.chat || "").trim(); + if (chat) { + const det = el("details", "enh-before"); + det.append(el("summary", null, "Chat sent"), el("div", "enh-before-text enh-ref-sent", chat)); + card.append(det); + } if (it.status) card.append(el("div", "enh-status", String(it.status))); return card; } diff --git a/tests/test_prompt_enhancer.py b/tests/test_prompt_enhancer.py index 9a5c33ee..b27d9049 100644 --- a/tests/test_prompt_enhancer.py +++ b/tests/test_prompt_enhancer.py @@ -637,3 +637,10 @@ def test_every_enhancement_path_passes_the_chat(): import inspect src = inspect.getsource(C.FunPackVideoRefinerV2.refine_v2) assert src.count("chat=self._v2_enhancer_chat(prompt_enhance_chat") == 3 + + +def test_every_readout_says_what_chat_the_model_was_sent(): + """Last run ▸ "Chat sent" is how a user checks what the model actually read.""" + import inspect + src = inspect.getsource(C.FunPackVideoRefinerV2.refine_v2) + assert src.count('"chat": ') == 3