sync update from LAN repo (source master @ ca48c4ec)
This commit is contained in:
1 parent
8bc8b0e082
commit
ea9dcff9c0
873 files changed
+107866
-14011
No files matched your search
@@ -1,5 +1,28 @@
|
||||
# DeerFlow Backend
|
||||
|
||||
## 首次问答初始化响应性(2026-10-30)
|
||||
|
||||
普通问答、开放问答接口和工作流智能体节点的模型 SDK 加载、客户端初始化及
|
||||
智能体构建统一在独立初始化线程执行,
|
||||
同时进入的构建请求异步排队。首次问答仍需等待初始化完成,但不会因此占住
|
||||
其他请求的处理主循环,已有对话可继续输出。用户身份、工具发现状态及 MCP
|
||||
连接仍按原会话隔离;初始化期间取消会等待当前构建收尾,随后结束,不再发起模型调用。
|
||||
AI 写作、子任务及深度研究的工具初始化也使用同一通道,避免首次发现或刷新
|
||||
MCP 工具时与其他问答互相等待。
|
||||
该优化只对重新加载代码的进程生效;已运行的子 Worker 可以继续使用旧版本,
|
||||
不会自动获得此优化。启用 Worker 池的生产主服务重启还涉及原有镜像轮换和
|
||||
流式连接断开策略,不能把这项修复当作不停机升级保证。
|
||||
|
||||
## 多文件上传响应性(2026-10-30)
|
||||
|
||||
会话附件的写入、格式校验和沙箱同步在独立工作池执行,每个后端进程最多同时
|
||||
处理 2 批上传,其余异步等待。PDF/Office 文档解析进一步放到最多 2 个独立进程,
|
||||
减少解析器对聊天请求的 CPU 争用。同一会话的上传按批次串行;列表和删除操作等待
|
||||
该批次完成或回滚。上传成功仍表示整批文件已处理完成,可以直接用于问答。
|
||||
文件数量、大小、类型限制以及失败回滚规则不变。更新后需重启后端生效。
|
||||
首次文档转换需要启动解析进程并加载依赖,后续复用进程;此时其他请求仍可响应。
|
||||
沙箱管理器的首次构造也有并发保护,避免两批上传同时首次进入时创建重复实例。
|
||||
|
||||
## 普通知识库智能检索双检索面(2026-10-16)
|
||||
|
||||
智能检索全局开关默认关闭,且只保存在数据库。管理员开启后,新对话默认使用智能检索,
|
||||
@@ -18,6 +41,10 @@
|
||||
并在建库前调用模型调试接口做一次真实可用性检查;调试失败时不会创建一个随后把全部文档送入
|
||||
Wiki 死信的知识库。模型默认项、知识库摘要模型和 Wiki 合成模型均由数据库保存,不写入业务配置文件。
|
||||
|
||||
知识库深度研究会话表 `knowledge_research_sessions` 由启动 `create_all` 创建。
|
||||
每次 `/api/threads/{id}/runs/stream` 都会按 thread 查这张表以判断是否绑定单库研究;
|
||||
表尚未建好时按普通问答处理,不会让流式接口因缺表而失败。
|
||||
|
||||
## 公文助手与网页报告校验优化(2026-10-07)
|
||||
|
||||
公文助手新增预置 `run_gongwen.py deliver` / `verify-file`,一次交付调用完成
|
||||
@@ -41,6 +68,22 @@ Python 脚本与重复检查。结构检查不替代事实核实和真实分页
|
||||
「当前文件正在生成,请稍等片刻,完成后就可以切换查看其他文件。」
|
||||
自动切换静默跳过,生成完成、停止或离开会话后解除保护。
|
||||
|
||||
## 网页报告校验优化(2026-10-07)
|
||||
|
||||
网页报告写入和校验时自动补齐深色组件及图表文字颜色。校验返回自动修复项、
|
||||
完整错误列表和 `repair_checklist`,要求集中完成局部修复后再校验,避免逐条
|
||||
循环和整页重写。遗留小字号声明不再单独拦截。
|
||||
|
||||
## 沙箱流式展示与切换保护(2026-10-07)
|
||||
|
||||
普通问答和智能体问答的 `write_file` 没有有效路径时,不创建占位制品来打开
|
||||
空沙箱,而在步骤条内用绿色小字流式展示正文;后续完整路径到达后恢复正常
|
||||
文件预览,正常文件的自动打开与沙箱实时展示保留。
|
||||
|
||||
当前预览文件正在生成或全文改写时,沙箱阻止切换到其他文件。用户操作时提示:
|
||||
「当前文件正在生成,请稍等片刻,完成后就可以切换查看其他文件。」
|
||||
自动切换静默跳过,生成完成、停止或离开会话后解除保护。
|
||||
|
||||
## 技能检索文件展示(2026-10-07)
|
||||
|
||||
普通问答、智能体问答中,技能返回的会话文件路径、原文件链接或知识库文档标识,
|
||||
@@ -77,6 +120,21 @@ OpenAI 兼容适配器对 `qwen3.8-flash-next` 自动启用按请求隔离的正
|
||||
|
||||
「单点登录(同账号仅一处在线)」由独立 `single_session_enabled` 控制,默认关闭;`sso_enabled` 仅表示既有外部单点/免登入口,两个功能分开。开启单处登录后,每次成功的账号密码、用户名口令、上游 token、并行面板、注册或初始化登录,都在数据库内原子递增该账号 `token_version` 后签新 JWT,旧会话立即返回 401,前端轮询 `/me` 后退出旧页面。失败登录不会踢人,关闭时允许多处会话并存;修改/重置密码仍始终撤销旧会话。并发登录通过同一行的原子递增保证最终仅最高版本会话有效;事务还比较已验证的密码/口令与权限快照,避免并发重置密码后旧凭据借新登录版本恢复。
|
||||
|
||||
### 任务详情技能免鉴权访问(2026-10-27)
|
||||
|
||||
右侧 `task-context` 与 `task-detail-update` 仅访问
|
||||
`GET/PUT /api/force-situation/tasks/{taskId}/detail`,不再调用登录、领取 JWT、读取 token 环境变量
|
||||
或发送 `Authorization`。两个脚本只保留 Gateway 地址配置;当前任务详情读写及版本读取路由在
|
||||
Gateway 鉴权与 CSRF 中间件中直接开放,因此不依赖 `password_login_enabled`、`sso_enabled`、
|
||||
账号密码、登录白名单或多实例 JWT 密钥配置。
|
||||
|
||||
既有定时详情技能仍会调用旧 `/api/parallel-agents/auth/token` 作为前置步骤。该接口在登录策略
|
||||
拒绝时返回非 JWT 兼容值,使旧技能可以继续调用已开放的详情接口;兼容值不能访问其他受保护路由。
|
||||
|
||||
`biz-detail-assistant` 的所有补充信息、范围选择和写回确认都必须使用原生
|
||||
`ask_clarification`;不得为该智能体排除该工具或由中间件伪造“用户协助”消息。原生澄清中间件负责
|
||||
暂停本轮、输出标准卡片并在用户回复后恢复同一会话。
|
||||
|
||||
普通知识库默认详情页面:管理员可在知识库顶部选择“本系统 Wiki 索引”或“嵌入 WeKnora”,对应 `ordinary_knowledge_landing`(默认 `wiki`)。Wiki 库首次进入默认展示本系统索引,右上角“打开 WeKnora”切换到内嵌管理页;内嵌页可返回索引。非 Wiki 库仍进入 WeKnora 文档页。设置通过 `/api/system-settings/ordinary-knowledge-landing` 保存,仅管理员可修改;指定文章、文档、图谱的直达链接优先于默认设置。
|
||||
|
||||
助手知识库可独立于 WeKnora 使用:管理员进入助手知识库,选择或创建库后点击“上传文件生成 Wiki”。支持 Markdown/TXT/CSV、PDF、Word、Excel、PowerPoint(单文件 100 MB,解析正文上限 400 万字符)。文件先写入运行目录 `assistant-knowledge/files/{job_id}`,后台分段调用已配置的语言模型生成分类 Wiki、实体关系,再通过 DeerFlow 编码器对正文分段向量化,保存到助手库并汇入知识梳理总库。无需配置 WeKnora URL;配置后仍可直接上传,也保留 WeKnora 数据包导入。文件处理沿用管理员写入权限。日常界面默认采用 `knowledge_base_product_version=v1`,普通用户只展示普通知识库;管理员始终可管理助手知识库,并可在知识库顶部设置中切换到 `v2`,向普通用户开放助手知识库入口、选择器和关联跳转。该开关是可恢复的产品展示开关:隐藏时日常问答的新运行不带助手库选择,但不会删除已有助手库或历史绑定;助手知识的既有读/搜索接口契约不因该开关改变。
|
||||
@@ -169,9 +227,9 @@ The single LangGraph agent (`lead_agent`) is the runtime entry point, created vi
|
||||
- **Subagent delegation** for parallel task execution
|
||||
- **System prompt** with skills injection, memory context, and working directory guidance
|
||||
|
||||
普通问答采用严格的输出载体门禁:只有本次请求明确要求 HTML、网页、页面、看板、大屏或 `.html` 文件时,才允许读取网页生成技能、调用页面模板工具或创建 HTML;“画流程图”“画图表”“画地图”“画思维导图”“做可视化”本身都不构成 HTML 意图。普通流程图直接在消息中输出 Mermaid,普通图表沿用既有消息内方式,普通地图输出 `map-json`。只有本次请求明确要求“思维导图 / 脑图 / 知识导图”或点名 `analysis-mindmap` 时,才会输出专用 `mindmap-json`;普通分析、总结、提纲和结构化 JSON 不会自动生成导图。未闭合的 `mindmap-json`(兼容历史 `mindmap` 围栏)会原样作为代码块流式显示,闭合且本地校验通过后才懒加载横向分析树预览。导图必须是一棵含唯一根节点的受限层级树:目标 12–24 个节点、硬上限 36 个,最多 4 层(含中心主题),中心主题至多 6 个一级维度、每个后续节点至多 3 个子节点;不得把报告的每个数据、段落或引用逐条转成节点。点击父节点本身,或其连线起点处的+/−,即可展开/收起子节点,且连接线明确可见;全量弹窗的右上角含关闭与视图工具、右下角含由实际布局绘制的全图预览,消息预览同样支持拖动、滚轮缩放和视图工具;消息卡片的单个下载图标会打开 PNG、SVG、JSON 选项。明确的 HTML 请求必须进入沙箱生成 `/mnt/user-data/outputs/*.html` 并通过 `present_files` 打开右侧制品预览,禁止用聊天中的完整 HTML 代码块代替文件。前端负责本地校验和渲染,并兼容模型误写成普通 `json` 围栏的合法地图契约;只有包含地图字段且通过完整 schema 校验的 JSON 才会按地图渲染,其他 JSON 保持原代码块。地图卡片占满消息内容区,与步骤条左右边界对齐;格式错误时显示可读错误与原始数据,不中断整条消息。
|
||||
普通问答采用严格的输出载体门禁:只有本次请求明确要求 HTML、网页、页面、看板、大屏或 `.html` 文件时,才允许读取网页生成技能、调用页面模板工具或创建 HTML;“画流程图”“画图表”“画地图”“画思维导图”“做可视化”本身都不构成 HTML 意图。普通流程图直接在消息中输出 Mermaid,普通图表沿用既有消息内方式,普通地图输出 `map-json`。只有本次请求明确要求“思维导图 / 脑图 / 知识导图”或点名 `analysis-mindmap` 时,才会输出专用 `mindmap-json`;普通分析、总结、提纲和结构化 JSON 不会自动生成导图。未闭合的 `mindmap-json`(兼容历史 `mindmap` 围栏)会原样作为代码块流式显示,闭合且本地校验通过后才懒加载横向分析树预览。导图必须是一棵含唯一根节点的受限层级树:目标 12–24 个节点、硬上限 36 个,最多 4 层(含中心主题),中心主题至多 6 个一级维度、每个后续节点至多 3 个子节点;不得把报告的每个数据、段落或引用逐条转成节点。点击父节点本身,或其连线起点处的+/−,即可展开/收起子节点,且连接线明确可见;全量弹窗的右上角含关闭与视图工具、右下角含由实际布局绘制的全图预览,消息预览同样支持拖动、滚轮缩放和视图工具;消息卡片的单个下载图标会打开 PNG、SVG、JSON 选项。明确的 HTML 请求必须进入沙箱生成 `/mnt/user-data/outputs/*.html` 并通过 `present_files` 打开右侧制品预览,禁止用聊天中的完整 HTML 代码块代替文件。前端负责本地校验和渲染,并兼容模型误写成普通 `json` 围栏的合法地图契约;只有包含地图字段且通过完整 schema 校验的 JSON 才会按地图渲染,其他 JSON 保持原代码块。解析前会把常见的 `coords`/`from`/`to`/`lng`/`lat` 写法归一成契约字段;标点可按 `color` 着色(未写则自动配色)。只有用户明确要求连线时才输出 `lines`,此时连线带箭头并沿线循环流动;无法恢复的连线会被丢弃,标点仍可渲染。地图卡片占满消息内容区,与步骤条左右边界对齐;格式错误时显示可读错误与原始数据,不中断整条消息。
|
||||
|
||||
生成 `.html` 网页、看板或大屏时使用独立的离线绘图契约:流程图使用 `data-df-flow` + AntV G6(不使用 Mermaid),图表使用 `data-df-chart`,地图使用本地 GeoJSON + ECharts Canvas 的 `data-df-geo`。Gateway 从公开路径 `/api/public/html-runtime/` 提供浏览器版 `g6.min.js`、`echarts.min.js`、`bootstrap.min.css`、`bootstrap.bundle.min.js`、`alpine.min.js` 和统一初始化脚本 `deerflow-runtime.js`,以及中国省级、美国州级、日本都道府县、台湾地区县市四份地图资源(`china-provinces` / `us-states` / `japan-prefectures` / `taiwan-counties`)。Bootstrap 负责布局与标准弹窗,Alpine 负责轻量状态和动态列表;生成的 HTML 源码会直接引用这些后台文件,不依赖前端 React 构建产物或公网 CDN。设置里的「HTML 地图」可选 ECharts 本地 GeoJSON,或地图网页(Leaflet);地图网页的瓦片模板是 `config.yaml -> html_runtime.map_tile_url`。运行时会等隐藏的逻辑页真实可见后再初始化 ECharts,并通过 `ResizeObserver` 跟随沙箱和页面容器尺寸变化,避免地图或图表首屏以零宽度渲染。区域/标点的 `description` 必须为纯文本,点击后由运行时显示详情浮层;需要筛选或切到明细页时监听 `deerflow:geo-map-click`,不能把链接、HTML 或 `onclick` 写进 `description`。深色 HTML 需声明 `data-df-theme="dark"`,其 ECharts 的全局、标题、图例、坐标轴和可见系列标签都必须显式使用浅色文字,避免 ECharts 默认黑字。这些文件作为 `packages/harness/deerflow/html_runtime/assets/` 的包资源随 harness wheel 一起发布,第三方许可同目录保存。`config.yaml -> html_runtime.base_url` 必须填写浏览器可访问的 Gateway Runtime 地址(本机默认 `http://localhost:8001/api/public/html-runtime`),运行时据此解析本地 GeoJSON 地址;内网部署只需把它替换为实际 Gateway 地址。用户上传的栅格图片若要作为生成 HTML 的背景图,智能体会使用同一 Gateway 源下的签名地址 `/api/public/html-images/{token}` 写入 `background-image`,不要写沙箱路径或制品接口。该能力不改变普通问答消息列表,普通问答地图仍走原有 `map-json` 前端瓦片渲染与 `frontend-web/public/runtime-config.js` 的 `VITE_MAP_TILE_URL`。地图大屏使用“中间地图舞台”而非整页地图背景:中间地图保持可见和可点击,两侧为窄信息栏、底部为摘要面板;提到的城市和行政区必须分别写入 `markers` 与高亮 `regions`。
|
||||
生成 `.html` 网页、看板或大屏时使用独立的离线绘图契约:流程图使用 `data-df-flow` + AntV G6(不使用 Mermaid),图表使用 `data-df-chart`,地图使用本地 GeoJSON + ECharts Canvas 的 `data-df-geo`。Gateway 从公开路径 `/api/public/html-runtime/` 提供浏览器版 `g6.min.js`、`echarts.min.js`、`bootstrap.min.css`、`bootstrap.bundle.min.js`、`alpine.min.js` 和统一初始化脚本 `deerflow-runtime.js`,以及中国省级、美国州级、日本都道府县、台湾地区县市四份地图资源(`china-provinces` / `us-states` / `japan-prefectures` / `taiwan-counties`)。Bootstrap 负责布局与标准弹窗,Alpine 负责轻量状态和动态列表;生成的 HTML 源码会直接引用这些后台文件,不依赖前端 React 构建产物或公网 CDN。设置里的「HTML 地图」可选 ECharts 本地 GeoJSON,或地图网页(Leaflet);地图网页的瓦片模板在设置 → 外观的「地图瓦片地址」中配置。运行时会等隐藏的逻辑页真实可见后再初始化 ECharts,并通过 `ResizeObserver` 跟随沙箱和页面容器尺寸变化,避免地图或图表首屏以零宽度渲染。区域/标点的 `description` 必须为纯文本,点击后由运行时显示详情浮层;需要筛选或切到明细页时监听 `deerflow:geo-map-click`,不能把链接、HTML 或 `onclick` 写进 `description`。深色 HTML 需声明 `data-df-theme="dark"`,其 ECharts 的全局、标题、图例、坐标轴和可见系列标签都必须显式使用浅色文字,避免 ECharts 默认黑字。这些文件作为 `packages/harness/deerflow/html_runtime/assets/` 的包资源随 harness wheel 一起发布,第三方许可同目录保存。设置 → 外观的「HTML 运行库地址」填写浏览器可访问的 Gateway Runtime 地址(未配置时默认 `http://localhost:8001/api/public/html-runtime`),运行时据此解析本地 GeoJSON 地址;内网部署在设置弹窗里改成用户能够打开的域名即可。用户上传的栅格图片若要作为生成 HTML 的背景图,智能体会使用同一 Gateway 源下的签名地址 `/api/public/html-images/{token}` 写入 `background-image`,不要写沙箱路径或制品接口。该能力不改变普通问答消息列表,普通问答地图仍走原有 `map-json` 前端瓦片渲染与 `frontend-web/public/runtime-config.js` 的 `VITE_MAP_TILE_URL`。地图大屏使用“中间地图舞台”而非整页地图背景:中间地图保持可见和可点击,两侧为窄信息栏、底部为摘要面板;提到的城市和行政区必须分别写入 `markers` 与高亮 `regions`。
|
||||
|
||||
从已有 Markdown 报告生成 HTML 时,必须根据材料盘点 Mermaid/流程图、图表及地图,并在 `page_report_template validate` 的 `required_features` 和 `page_brief` 中如实声明。流程图必须包含 `g6.min.js`、`deerflow-runtime.js`、`.df-flow` 与 `data-df-flow`,并拒绝 Mermaid、手写 HTML/CSS 流程节点以及页面内自行初始化 `G6.Graph`;图表和地图分别检查 ECharts 资源与 `data-df-chart` / `data-df-geo` 声明式数据块。`data-df-chart` 必须是严格 JSON,校验会拒绝函数、箭头函数和其他 JavaScript 回调;颜色使用字面量或数据项 `itemStyle`,提示文本使用字符串模板。地图只能使用上述四个内置 GeoJSON,校验会拒绝 Leaflet、`data-df-map`、瓦片和页面内自行初始化 ECharts。默认页面从零开始直接写入最终 outputs HTML,不读取或预览模板;只有用户明确要求模板时,prepare 才会把要求持久化到同名 brief,validate 会自动恢复并与调用参数合并。校验失败时不得交付,必须修复后重新校验。
|
||||
|
||||
@@ -292,7 +350,7 @@ FastAPI application providing REST endpoints for frontend integration:
|
||||
| `GET/POST /api/agents` | List visible agents or create a user-owned agent |
|
||||
| `GET/PUT/DELETE /api/agents/{id}` | Read, update, or delete an id-addressed agent |
|
||||
| `GET/POST/PUT/DELETE /api/roundtable-chains` | Manage user-owned roundtable business chains; each seat may optionally carry `position_id` for the separate position-collaboration workspace, plus `human_validation` to mark a Step 2 client-side pause checkpoint after that seat/stage completes (the original roundtable has no extra validation card) |
|
||||
| `GET/PUT /api/business-mapping` | Read global business mappings (seeded 3Q/6BF/7BF/8BF/AFX plus independent slots 3q-0…3q-6, 6-1…6-4, 7-1…7-4). Updates to 3Q/6BF/7BF and the independent slots require an administrator; the 8BF public business-chain mapping is maintained exclusively by the trusted `lqq` account (derived from the authenticated email prefix). |
|
||||
| `GET/PUT /api/business-mapping` | Read global business mappings (seeded 3Q/6BF/7BF/8BF/AFX plus independent slots 3q-0…3q-6, 6-1…6-4, 7-1…7-4). `3q-1…3q-6` seed as custom-type rows and stay off the configuration-page list. Updates to 3Q/6BF/7BF and the independent slots require an administrator; the 8BF public business-chain mapping is maintained exclusively by the trusted `lqq` account (derived from the authenticated email prefix). |
|
||||
| `GET/POST/PUT /api/position-roundtable/sessions` | Standalone position-collaboration sessions: freeze task/intent/chain snapshots, index one direct-agent node per seat, build upstream handoff context (including bounded UTF-8 excerpts of text artifacts), and make archived sessions read-only without invoking the original roundtable coordinator or jobs. Built-in summary/action-plan completion mirrors visible report text into a Markdown artifact when a model omits its final `write_file` call. `POST /sessions/{id}/nodes/{nodeKey}/reject` accepts an optional reason, marks the rejected delivery for rework, and invalidates affected downstream deliveries so they are regenerated in order. The same router is also mounted at `/api/multi-agent/position-roundtable/*` for intranet gateways that only forward the established multi-agent namespace; the compatibility mount is intentionally omitted from OpenAPI. |
|
||||
| `GET /api/memory` | Retrieve memory data |
|
||||
| `POST /api/memory/reload` | Force memory reload |
|
||||
@@ -1579,6 +1637,99 @@ Gateway 启动时会尽力执行应用 ORM、LangGraph Checkpointer 和 Store
|
||||
`Automatic ORM schema creation failed`、`in-memory fallback` 或启动填充失败信息修复
|
||||
数据库权限和表结构,并重启服务恢复持久化能力。
|
||||
|
||||
## Thread query performance and PostgreSQL ORM deadlines
|
||||
|
||||
Thread search/count now push common metadata and system-thread filters into SQL,
|
||||
preserving private ownership and shared taskId + agent/action filtering. Nested
|
||||
filters, the openGauss dialect and PG/MySQL numeric filters retain the exact
|
||||
compatibility path. MySQL string identifiers compare case and trailing spaces
|
||||
exactly. These changes reduce application-side scanning; JSON indexes still need
|
||||
to be selected from the deployed database's query plan.
|
||||
|
||||
For PostgreSQL ORM connections, `database.pool_recycle` defaults to 300 seconds
|
||||
when omitted, and `database.command_timeout` defaults to 30 seconds. Set the latter
|
||||
to a positive finite number or `null` to disable. Explicit pool settings remain
|
||||
effective; MySQL/openGauss keep their 1800-second recycle default. The asyncpg
|
||||
deadline is also applied when rebuilding the engine after database creation.
|
||||
MySQL/SQLite drivers do not receive asyncpg arguments. These ORM settings do not
|
||||
remove checkpoint saver lock waits or configure the separate psycopg pool.
|
||||
|
||||
Thread creation now defaults to metadata-only persistence: the first graph run
|
||||
creates its checkpoint. `initialize_checkpoint: true` retains eager initialization
|
||||
for integration clients. Authorized empty threads expose an empty state/history;
|
||||
private ownership, task sharing and agent/action partitioning remain unchanged.
|
||||
Thread metadata GET uses the business database; `include_state=true` opts into
|
||||
checkpoint values, and checkpoint-only legacy threads retain their fallback.
|
||||
|
||||
The frontend now releases the composer on an explicit stream end and refreshes
|
||||
final history in the background. Thread/run/generation guards reject late results
|
||||
after another send or navigation, including stale replica snapshots. Sync timeout
|
||||
or failure preserves the streamed answer; EOF without an end still uses recovery.
|
||||
|
||||
Login, identity, user management and SQL business repositories use `database`;
|
||||
with `backend: mysql` they do not query the PG checkpointer. Runtime initialization,
|
||||
legacy LangGraph Store migration and explicit conversation/agent-state operations
|
||||
can still use PG. This change does not migrate those stores or existing data.
|
||||
|
||||
See [thread latency implementation and database separation](docs/THREAD_LATENCY_OPTIMIZATION_ZH.md)
|
||||
for configuration precedence, MySQL-only thread creation, background history
|
||||
refresh, compatibility limits and validation scope.
|
||||
|
||||
Artifact directory scans, skill ZIP previews, content sniffing and text writes now
|
||||
use a bounded file executor separate from login's default executor. Completed runs
|
||||
leave the live registry after a five-minute grace period only once their tasks
|
||||
have stopped and their final snapshots have been verified in the RunStore. SQL
|
||||
history, checkpoints and the existing SSE replay buffer are not deleted.
|
||||
|
||||
The `run_events.backend: memory` compatibility setting now uses a local SQLite
|
||||
event spool at `${DEER_FLOW_HOME}/run-events/events.sqlite3` (default
|
||||
`.deer-flow/run-events/events.sqlite3`). Full messages and events stay on disk;
|
||||
there is no automatic history TTL or content truncation. Keep that runtime
|
||||
directory on a writable persistent local volume, including its WAL files.
|
||||
Explicit `db` continues to use the business database (MySQL when configured),
|
||||
and `jsonl` keeps its existing files while moving disk IO off the event loop.
|
||||
No existing SQL/JSONL events or conversation checkpoints are migrated.
|
||||
|
||||
Background subagents and roundtable turns use user round-robin queues with both
|
||||
global and per-user admission limits. Queued work occupies no execution slot;
|
||||
cancellation must finish the actual child before releasing its slot. Optional
|
||||
`config.yaml` budgets (effective after restart):
|
||||
|
||||
```yaml
|
||||
runtime_contention:
|
||||
completed_run_retention_seconds: 300
|
||||
run_sweep_seconds: 10
|
||||
subagent_concurrency: 3
|
||||
subagent_per_user: 2
|
||||
background_concurrency: 4
|
||||
background_per_user: 2
|
||||
queue_limit: 256
|
||||
```
|
||||
|
||||
The existing `ROUNDTABLE_BACKGROUND_SLOTS_PER_USER` variable still overrides the
|
||||
roundtable per-user budget, capped by its global limit. Each user also has a
|
||||
bounded pending queue; overload returns an explicit failure rather than growing
|
||||
an unlimited backlog. A subagent deadline includes its queue wait.
|
||||
|
||||
Multi-agent roundtable step 2 has a separate room cap. Administrators change
|
||||
it under Settings → 会商并发 (`roundtable_room_limit`, default on, 3 rooms)
|
||||
without restarting. The count is the number of live roundtable executions
|
||||
across every account (foreground leases/live LangGraph runs plus executing
|
||||
background jobs), not the current login. Merely opening a tab or viewing chat
|
||||
history does not count, but two tabs that both run the same saved draft count
|
||||
as two rooms. All seats and Step 3 work in one execution share one room;
|
||||
foreground-to-background handoff keeps one room. A full pool keeps the user on
|
||||
step 1.
|
||||
|
||||
Roundtable seat/coordinator creation is metadata-only too. The authoritative seat
|
||||
list is included in the first real leader input, including for older clients;
|
||||
ordinary messages, broadcasts and resumable execution retain their persistence.
|
||||
The master integration also retains dedicated task deep-link history cards and
|
||||
their indexed queries, plus bounded display snapshots for long conversations.
|
||||
See [multi-user contention audit and implementation](docs/MULTI_USER_CONTENTION_AUDIT_ZH.md)
|
||||
for regression scope, remaining shared resources and production metrics. Local
|
||||
test results do not establish production capacity.
|
||||
|
||||
## openGauss / GaussDB application database
|
||||
|
||||
The application ORM can use a PG-compatible openGauss/GaussDB database through
|
||||
@@ -1661,12 +1812,14 @@ Beta(8,2) 先验抑制小样本极值;零样本返回 `score: null` 和
|
||||
`VITE_COMPACT_MENU_TYPE` 隔离 A/B 两套菜单。
|
||||
## 技能读取、模型日志与线程池并发优化
|
||||
|
||||
实际加载的 `config.yaml`(`DEER_FLOW_CONFIG_PATH` 指定文件优先)支持以下四个独立开关。
|
||||
实际加载的 `config.yaml`(`DEER_FLOW_CONFIG_PATH` 指定文件优先)支持以下独立开关。
|
||||
`skill_view_reuse_enabled` 和 `skill_view_cache_enabled` 在配置里不写时默认开启;
|
||||
要恢复每次工具调用都全量刷新技能视图,把对应项写成 `false` 后重启。另外两项仍默认关闭:
|
||||
要恢复每次工具调用都全量刷新技能视图,把对应项写成 `false` 后重启。
|
||||
模型计时与线程池开关默认关闭,工具统计写入也默认暂停:
|
||||
|
||||
```yaml
|
||||
runtime_performance:
|
||||
tool_metrics_enabled: false
|
||||
skill_view_reuse_enabled: true
|
||||
skill_view_cache_enabled: true
|
||||
model_timing_nonblocking_enabled: true
|
||||
@@ -1674,6 +1827,13 @@ runtime_performance:
|
||||
asyncio_thread_pool_size: 100
|
||||
```
|
||||
|
||||
- `tool_metrics_enabled`:工具/技能调用统计写入开关,**缺省为 false(暂停)**,旧部署配置
|
||||
没有此项时也暂停。主智能体和子智能体不再装载工具统计中间件,不创建统计写库任务、
|
||||
不执行技能统计合并查询,从源头减少与登录共用业务数据库连接池的竞争。
|
||||
正常工具调用、错误处理、问答消息/checkpoint 和模型调用统计继续运行;已有
|
||||
`tool_call_metrics` 记录与查询/导出接口保留。暂停期间工具/技能审计明细及排行榜的
|
||||
工具/技能调用计数不再新增,且不缓存或事后补录。恢复时设为 `true` 并重启后台。
|
||||
部署新代码并重启后才对所有运行实例生效;这不消除历史统计查询或其他数据库操作的开销。
|
||||
- `skill_view_reuse_enabled`:一次沙箱工具调用共用一份已验证技能视图,路径检查、
|
||||
本地/AIO 沙箱初始化、命令转换和输出脱敏不再反复刷新。下一次工具调用重新验证,
|
||||
不跨问答永久沿用启停状态。
|
||||
@@ -1694,7 +1854,7 @@ runtime_performance:
|
||||
开启时选中变量的无效值使启动失败。线程按需创建,不会在启动时立即创建 100 个线程。
|
||||
|
||||
修改后重启后台以确保全部运行实例使用一致配置;回退时将相应项设为 `false` 并重启,
|
||||
无需删除技能或缓存目录。启动/配置加载日志 `RUNTIME_PERFORMANCE` 会打印四项开关及 YAML 中的上限。
|
||||
无需删除技能或缓存目录。启动/配置加载日志 `RUNTIME_PERFORMANCE` 会打印开关及 YAML 中的上限。
|
||||
`GATEWAY_ASYNCIO_EXECUTOR` 才是线程池最终生效值(含环境变量优先级)及来源;线程池改动必须重启生效。
|
||||
技能日志 `SKILL_VIEW_CACHE` 含 `status`、`lock_wait_ms`、`refresh_ms`、`total_ms`、
|
||||
源/目标条目数及启用技能数;正常命中为 DEBUG,重建/合并等待为 INFO,配合
|
||||
|
||||
Reference in new issue
Block a user