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

@@ -13,6 +13,7 @@ from types import SimpleNamespace
import pytest
from app.services.agent_registry.resolver import resolve_agent_code
from app.services.agent_runtime_context import AGENT_RUNTIME_CONTEXT_INPUT
from app.services.agent_runtime_context.bootstrap import load_context_adapters
from app.services.agent_runtime_context.registry import (
CONTEXT_ADAPTER_REGISTRY,
@@ -76,14 +77,14 @@ def test_build_chat_dify_inputs_routes_file_check_by_registered_agent_code(monke
'app.services.file_check_tools.context_adapter.build_file_check_dify_inputs',
lambda current_agent, required, **kwargs: {
'adapter': 'file_check',
'task_id': '7',
AGENT_RUNTIME_CONTEXT_INPUT: '{"refs":{"schedule_task_id":"7"}}',
'required': required,
},
)
inputs = build_chat_dify_inputs(agent, session_id='conv-file-check-002')
assert inputs['adapter'] == 'file_check'
assert inputs['task_id'] == '7'
assert AGENT_RUNTIME_CONTEXT_INPUT in inputs
def test_register_context_adapter_allows_custom_code():