F2: persist native job projections and expose task controls

This commit is contained in:
Xin Wang
2026-10-23 16:03:40 +08:00
parent bae5ec3c58
commit 33fde56edd
13 changed files with 550 additions and 5 deletions
+7
View File
@@ -242,6 +242,11 @@ async def _validate_tool_bindings(
missing = sorted(tool_ids - set(tools))
if missing:
raise HTTPException(400, "工具不存在或未启用: " + ", ".join(missing))
task_tools = [tool for tool in tools.values() if tool.type == "task"]
if task_tools and (body.type != "prompt" or body.runtime_mode != "pipeline"):
raise HTTPException(400, "后台任务工具仅支持提示词 Pipeline")
if len(task_tools) > 1:
raise HTTPException(400, "每个助手最多绑定一个后台任务工具")
reserved = sorted(
tool.function_name
for tool in tools.values()
@@ -282,6 +287,8 @@ async def _validate_tool_bindings(
type=tool.type,
definition=tool.definition or {},
)
if tool.type == "task" and binding.result_assignments:
raise HTTPException(400, "后台任务结果通过任务通知返回,不支持结果变量映射")
properties, required = ToolExecutor.input_schema(runtime_tool)
unknown = sorted(set(binding.argument_bindings) - set(properties))
if unknown: