F1: add reusable task backend resources and migrate task tools

This commit is contained in:
Xin Wang
2026-10-23 23:45:50 +08:00
parent e958491201
commit 529250173d
17 changed files with 741 additions and 43 deletions
+3
View File
@@ -22,6 +22,7 @@ from models import (
RuntimeToolBinding,
)
from services.node_specs import copy_graph, graph_references
from services.task_backend_resources import resolve_task_backend
from sqlalchemy import or_, select
from sqlalchemy.ext.asyncio import AsyncSession
@@ -174,6 +175,7 @@ async def _tools_for(
.where(
or_(*identity_filters),
Tool.status == "active",
Tool.type.in_(("http", "mcp", "client")),
)
)
).scalars().all()
@@ -323,6 +325,7 @@ async def resolve_runtime_config(
built_in_tools=assistant.built_in_tools or {},
tools=runtime_tools,
tool_bindings=prompt_tool_bindings,
task_backend=await resolve_task_backend(session, assistant),
knowledge_base_id=assistant.knowledge_base_id,
knowledge_base_name=knowledge_base.name if knowledge_base else "",
knowledge_base_description=knowledge_base.description if knowledge_base else "",