From 9f715d6bc2717cc26e153c505124ba3a2e50d285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E6=B5=B7=E8=92=BC=E7=81=86?= Date: Thu, 20 Nov 2025 10:11:28 +0800 Subject: [PATCH] Feature (canvas): Add mind tagging support (#11359) ### What problem does this PR solve? Resolve the issue of missing thinking labels when viewing pre-existing conversations ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- api/db/services/canvas_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/db/services/canvas_service.py b/api/db/services/canvas_service.py index 5a0f82c2b..db8e16068 100644 --- a/api/db/services/canvas_service.py +++ b/api/db/services/canvas_service.py @@ -223,6 +223,10 @@ def completion(tenant_id, agent_id, session_id=None, **kwargs): ans["session_id"] = session_id if ans["event"] == "message": txt += ans["data"]["content"] + if ans["data"].get("start_to_think", False): + txt += "" + elif ans["data"].get("end_to_think", False): + txt += "" yield "data:" + json.dumps(ans, ensure_ascii=False) + "\n\n" conv.message.append({"role": "assistant", "content": txt, "created_at": time.time(), "id": message_id})