From 5cf8bdabfd60f0e057dc8e60976541035351b96f Mon Sep 17 00:00:00 2001 From: sal Date: Mon, 1 Jun 2026 13:08:30 +0900 Subject: [PATCH] Handle __status tokens for instant thinking box feedback __status tokens show immediately in the thinking box but do not accumulate in thinking_acc. When real content (__meta/__thinking) arrives it overwrites the status message naturally. Co-Authored-By: Claude Sonnet 4.6 --- app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.py b/app.py index 082e8bb..c361b86 100644 --- a/app.py +++ b/app.py @@ -116,6 +116,12 @@ async def respond(message, history, show_thinking, user_id, use_tts, run_ids): collected_run_id = run_id break + # 즉시 상태 표시 — thinking_acc에 누적하지 않음 (임시 메시지) + if isinstance(token, dict) and "__status" in token: + status_text = (thinking_acc + "\n\n" + token["__status"]) if thinking_acc else token["__status"] + yield history, "", None, run_ids, _thinking_html(status_text) + continue + # 사고 과정(LLM thinking) — 박스에 추가 if isinstance(token, dict) and "__thinking" in token: thinking_acc += token["__thinking"]