feat(file-check): 持久化 chat_tool_runs 并统一 agent_runtime_context 注入

新增跨 worker 进度绑定表与显式 hxops_turn_id 链路;Dify Start 仅注入
agent_runtime_context,task_id/turn_id 写入 refs 供画布解析后回传 Tool。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-07-09 18:39:05 +08:00
1 parent c778f40fbc
commit f4e74f7b07
23 files changed
+1580 -196

No files matched your search

+20
View File
@@ -1276,6 +1276,26 @@ class DifyService:
)
if not chat_log_id:
return None
try:
from app.services.file_check_tools.chat_tool_run_binding import bind_chat_log
bind_chat_log(
chat_log_id=int(chat_log_id),
turn_id=hxops_turn_id,
session_id=session_id,
query=query,
schedule_run_id=run_id,
)
except Exception as exc:
if current_app:
current_app.logger.warning(
'[file-check-bind] bind_chat_log failed chat_log_id=%s session_id=%s turn_id=%s request_id=%s err=%s',
chat_log_id,
session_id or None,
hxops_turn_id or None,
request_id,
exc,
)
return {"chat_log_id": chat_log_id, "run_id": run_id}
@staticmethod