feat: 集成 DeerFlow Agent Runner 并优化流式处理 (#5581)

* feat: integrate DeerFlow agent runner and improve stream handling

* refactor: split DeerFlow stream flow and close stale client on reset

* fix: enforce max_step and correct timeout type check

* fix: harden DeerFlow config parsing and session lifecycle

* fix: preserve third-party runner error semantics and harden image parsing

* perf: bound DeerFlow values history and seen-id cache

* refactor: improve deerflow stream semantics and client lifecycle

* fix: harden third-party runner error semantics and fallback aggregation

* refactor: reduce deerflow image log noise and lazy-init api session

* perf: avoid unnecessary iterable copies in deerflow stream utils

* refactor: centralize runner error key and clarify deerflow client lifecycle

* refactor: simplify third-party runner output flow

* fix: defer streaming runner cleanup and unify error mapping

* fix: handle id-less values messages and redact stream payload logs

* fix: improve deerflow error signaling and third-party runner flow

* fix: support deerflow proxy and refine runner lifecycle

* fix: tighten deerflow image validation and runner lifecycle

* feat: support deerflow image output components

* fix: harden runner stream cleanup and refactor deerflow config

* fix: preserve deerflow done hook and simplify runner lifecycle

* refactor: simplify third-party runner aggregation and lifecycle closing

* fix: preserve first deerflow values payload and simplify runner flow

* refactor: unify runner final resolution and harden deerflow close state

* refactor: share int coercion and make deerflow close best effort

* refactor: extract deerflow mappers and streamline third-party lifecycle

* refactor: simplify third-party flow and harden sse flush parsing

* fix: make deerflow runner close path best effort

* refactor: simplify third-party orchestration and centralize deerflow keys

* refactor: simplify third-party chunk flow and deerflow finalization

* fix: harden deerflow stream parsing and simplify runner lifecycle

* refactor: remove redundant deerflow values text assignment

* fix: improve deerflow timeout diagnostics and image input feedback

* refactor: flatten third-party runner lifecycle and aggregation

* chore: use deerflow official remote svg icon

* chore: remove unused deerflow local logo asset
This commit is contained in:
エイカク
2026-03-01 12:31:38 +09:00
committed by GitHub
parent 93decaa997
commit 451ad685ae
16 changed files with 1849 additions and 66 deletions
@@ -3,7 +3,7 @@
"name": "AI",
"agent_runner": {
"description": "Agent Runner",
"hint": "Select the runner for AI conversations. Defaults to AstrBot's built-in Agent runner, which supports knowledge base, persona, and tool calling features. You don't need to modify this section unless you plan to integrate third-party Agent runners like Dify or Coze.",
"hint": "Select the runner for AI conversations. Defaults to AstrBot's built-in Agent runner, which supports knowledge base, persona, and tool calling features. You don't need to modify this section unless you plan to integrate third-party Agent runners like Dify, Coze, or DeerFlow.",
"provider_settings": {
"enable": {
"description": "Enable",
@@ -15,7 +15,8 @@
"Built-in Agent",
"Dify",
"Coze",
"Alibaba Cloud Bailian Application"
"Alibaba Cloud Bailian Application",
"DeerFlow"
]
},
"coze_agent_runner_provider_id": {
@@ -26,6 +27,9 @@
},
"dashscope_agent_runner_provider_id": {
"description": "Alibaba Cloud Bailian Application Agent Runner Provider ID"
},
"deerflow_agent_runner_provider_id": {
"description": "DeerFlow Agent Runner Provider ID"
}
}
},
@@ -1363,6 +1367,45 @@
"description": "API Base URL",
"hint": "Base URL for the Coze API. Default: https://api.coze.cn"
},
"deerflow_api_base": {
"description": "API Base URL",
"hint": "DeerFlow API gateway URL. Default: http://127.0.0.1:2026"
},
"deerflow_api_key": {
"description": "DeerFlow API Key",
"hint": "Optional. Fill this if your DeerFlow gateway is protected by Bearer auth."
},
"deerflow_auth_header": {
"description": "Authorization Header",
"hint": "Optional. Custom Authorization header value; takes precedence over DeerFlow API Key."
},
"deerflow_assistant_id": {
"description": "Assistant ID",
"hint": "LangGraph assistant_id, default is lead_agent."
},
"deerflow_model_name": {
"description": "Model name override",
"hint": "Optional. Overrides DeerFlow default model (maps to runtime context model_name)."
},
"deerflow_thinking_enabled": {
"description": "Enable thinking mode"
},
"deerflow_plan_mode": {
"description": "Enable plan mode",
"hint": "Maps to DeerFlow is_plan_mode."
},
"deerflow_subagent_enabled": {
"description": "Enable subagent",
"hint": "Maps to DeerFlow subagent_enabled."
},
"deerflow_max_concurrent_subagents": {
"description": "Max concurrent subagents",
"hint": "Maps to DeerFlow max_concurrent_subagents. Effective only when subagent is enabled. Default: 3."
},
"deerflow_recursion_limit": {
"description": "Recursion limit",
"hint": "Maps to LangGraph recursion_limit."
},
"auto_save_history": {
"description": "Conversation history managed by Coze",
"hint": "When enabled, Coze manages conversation history. AstrBot's locally saved context will not take effect (read-only), and operations on AstrBot context will not apply. If disabled, AstrBot manages the context."
@@ -3,7 +3,7 @@
"name": "AI 配置",
"agent_runner": {
"description": "Agent 执行方式",
"hint": "选择 AI 对话的执行器,默认为 AstrBot 内置 Agent 执行器,可使用 AstrBot 内的知识库、人格、工具调用功能。如果不打算接入 Dify 或 Coze 等第三方 Agent 执行器,不需要修改此节。",
"hint": "选择 AI 对话的执行器,默认为 AstrBot 内置 Agent 执行器,可使用 AstrBot 内的知识库、人格、工具调用功能。如果不打算接入 Dify、Coze、DeerFlow 等第三方 Agent 执行器,不需要修改此节。",
"provider_settings": {
"enable": {
"description": "启用",
@@ -15,7 +15,8 @@
"内置 Agent",
"Dify",
"Coze",
"阿里云百炼应用"
"阿里云百炼应用",
"DeerFlow"
]
},
"coze_agent_runner_provider_id": {
@@ -26,6 +27,9 @@
},
"dashscope_agent_runner_provider_id": {
"description": "阿里云百炼应用 Agent 执行器提供商 ID"
},
"deerflow_agent_runner_provider_id": {
"description": "DeerFlow Agent 执行器提供商 ID"
}
}
},
@@ -1366,6 +1370,45 @@
"description": "API Base URL",
"hint": "Coze API 的基础 URL 地址,默认为 https://api.coze.cn"
},
"deerflow_api_base": {
"description": "API Base URL",
"hint": "DeerFlow API 网关地址,默认为 http://127.0.0.1:2026"
},
"deerflow_api_key": {
"description": "DeerFlow API Key",
"hint": "可选。若 DeerFlow 网关配置了 Bearer 鉴权,则在此填写。"
},
"deerflow_auth_header": {
"description": "Authorization Header",
"hint": "可选。自定义 Authorization 请求头,优先级高于 DeerFlow API Key。"
},
"deerflow_assistant_id": {
"description": "Assistant ID",
"hint": "LangGraph assistant_id,默认为 lead_agent。"
},
"deerflow_model_name": {
"description": "模型名称覆盖",
"hint": "可选。覆盖 DeerFlow 默认模型(对应 runtime context 的 model_name)。"
},
"deerflow_thinking_enabled": {
"description": "启用思考模式"
},
"deerflow_plan_mode": {
"description": "启用计划模式",
"hint": "对应 DeerFlow 的 is_plan_mode。"
},
"deerflow_subagent_enabled": {
"description": "启用子智能体",
"hint": "对应 DeerFlow 的 subagent_enabled。"
},
"deerflow_max_concurrent_subagents": {
"description": "子智能体最大并发数",
"hint": "对应 DeerFlow 的 max_concurrent_subagents。仅在启用子智能体时生效,默认 3。"
},
"deerflow_recursion_limit": {
"description": "递归深度上限",
"hint": "对应 LangGraph recursion_limit。"
},
"auto_save_history": {
"description": "由 Coze 管理对话记录",
"hint": "启用后,将由 Coze 进行对话历史记录管理, 此时 AstrBot 本地保存的上下文不会生效(仅供浏览), 对 AstrBot 的上下文进行的操作也不会生效。如果为禁用, 则使用 AstrBot 管理上下文。"
+1
View File
@@ -25,6 +25,7 @@ export function getProviderIcon(type) {
'dify': 'https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/dify-color.svg',
"coze": "https://registry.npmmirror.com/@lobehub/icons-static-svg/1.66.0/files/icons/coze.svg",
'dashscope': 'https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/alibabacloud-color.svg',
'deerflow': 'https://cdn.jsdelivr.net/gh/bytedance/deer-flow@main/frontend/public/images/deer.svg',
'fastgpt': 'https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/fastgpt-color.svg',
'lm_studio': 'https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/lmstudio.svg',
'fishaudio': 'https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/fishaudio.svg',