From e3f0965b2a2e83699f280a5c489c68fe1994bb3a Mon Sep 17 00:00:00 2001 From: cfdaily Date: Fri, 29 May 2026 08:38:03 +0800 Subject: [PATCH] fix: blackboard_routes mention_queue linkage (missed by auto-sync) --- src/api/blackboard_routes.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/api/blackboard_routes.py b/src/api/blackboard_routes.py index 0974dc0..64038f3 100644 --- a/src/api/blackboard_routes.py +++ b/src/api/blackboard_routes.py @@ -261,9 +261,24 @@ async def get_comments(project_id: str, task_id: str, @router.post("/tasks/{task_id}/comments") async def add_comment(project_id: str, task_id: str, body: Dict[str, Any]): bb = _bb(project_id) + mentions_raw = body.get("mentions") cid = bb.add_comment(task_id, body["author"], body["body"], comment_type=body.get("comment_type", "general"), - mentions=body.get("mentions")) + mentions=mentions_raw) + # v2.9 #01: 写入 mention_queue + if mentions_raw: + if isinstance(mentions_raw, str): + import json as _json + try: + mentions_list = _json.loads(mentions_raw) + except Exception: + mentions_list = [] + elif isinstance(mentions_raw, list): + mentions_list = mentions_raw + else: + mentions_list = [] + if mentions_list: + bb.record_mentions(cid, task_id, mentions_list) return {"ok": True, "comment_id": cid}