sync update from LAN repo (source master @ c21a2a4a)

This commit is contained in:
gozeros committed 2026-11-10 14:03:50 +08:00
1 parent ea9dcff9c0
commit 66a443e915
140 files changed
+13777 -1040

No files matched your search

+27 -7
View File
@@ -1,5 +1,18 @@
# DeerFlow Backend
## 技能调用识别与统计(2026-11-07)
技能调用的展示和“调用次数”不再依赖模型主动说明。后端以真实工具信号为准:
成功的 `skill_view`、对 `/mnt/skills/{public,custom}/<name>/...` 的文件读取,
以及 `bash` 直接执行该目录下的技能脚本,都会识别为对应技能调用。一次问答中同一技能即使先读
`SKILL.md`、再读参考文件并执行多个脚本,也只累计一次;不同问答分别累计。
计数会同时更新 `.usage.json` 和技能列表使用的数据库投影,因此内置技能与自定义技能都能在
页面刷新后看到最新调用次数。对话步骤也直接从 `skill_view` 参数或真实技能路径显示
“调用技能「名称」”;弱模型未填写工具描述、未在正文里自述技能名时仍可识别。
完整工具审计仍由 `runtime_performance.tool_metrics_enabled` 独立控制;默认开启的
`skill_metrics_enabled` 只把可归因到具体技能的低频调用写入统计表,供技能排行和调用统计使用。
## 首次问答初始化响应性(2026-10-30)
普通问答、开放问答接口和工作流智能体节点的模型 SDK 加载、客户端初始化及
@@ -1715,7 +1728,9 @@ 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
background jobs), not the current login. A foreground lease stays occupied for
``lease_minutes`` without a renewal (default 5 minutes, range 1–60) and is
refreshed by the page heartbeat. 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
@@ -1815,11 +1830,12 @@ Beta(8,2) 先验抑制小样本极值;零样本返回 `score: null` 和
实际加载的 `config.yaml`(`DEER_FLOW_CONFIG_PATH` 指定文件优先)支持以下独立开关。
`skill_view_reuse_enabled` 和 `skill_view_cache_enabled` 在配置里不写时默认开启;
要恢复每次工具调用都全量刷新技能视图,把对应项写成 `false` 后重启。
模型计时与线程池开关默认关闭,工具统计写入也默认暂停:
模型计时与线程池开关默认关闭,普通工具审计默认暂停,低频技能统计默认保留:
```yaml
runtime_performance:
tool_metrics_enabled: false
skill_metrics_enabled: true
skill_view_reuse_enabled: true
skill_view_cache_enabled: true
model_timing_nonblocking_enabled: true
@@ -1827,13 +1843,17 @@ runtime_performance:
asyncio_thread_pool_size: 100
```
- `tool_metrics_enabled`:工具/技能调用统计写入开关,**缺省为 false(暂停)**,旧部署配置
没有此项时也暂停。主智能体和子智能体不再装载工具统计中间件,不创建统计写库任务、
不执行技能统计合并查询,从源头减少与登录共用业务数据库连接池的竞争。
- `tool_metrics_enabled`:普通工具审计写入开关,**缺省为 false(暂停)**,旧部署配置
没有此项时也暂停。主智能体和子智能体不会为普通工具创建统计写库任务,
从源头减少与登录共用业务数据库连接池的竞争。
正常工具调用、错误处理、问答消息/checkpoint 和模型调用统计继续运行;已有
`tool_call_metrics` 记录与查询/导出接口保留。暂停期间工具/技能审计明细及排行榜的
工具/技能调用计数不再新增,且不缓存或事后补录。恢复时设为 `true` 并重启后台。
`tool_call_metrics` 记录与查询/导出接口保留。暂停期间普通工具调用计数不再新增,
且不缓存或事后补录。恢复时设为 `true` 并重启后台。
部署新代码并重启后才对所有运行实例生效;这不消除历史统计查询或其他数据库操作的开销。
- `skill_metrics_enabled`:只记录从 `skill_view` 参数或
`/mnt/skills/{public,custom}/<name>/...` 工具路径确定出的技能调用,缺省为 `true`。
非技能工具直接透传,不执行技能合并查询或写库;因此普通工具审计暂停时,技能排行与
技能调用统计仍会更新。若连这部分低频写入也要暂停,显式设为 `false` 并重启。
- `skill_view_reuse_enabled`:一次沙箱工具调用共用一份已验证技能视图,路径检查、
本地/AIO 沙箱初始化、命令转换和输出脱敏不再反复刷新。下一次工具调用重新验证,
不跨问答永久沿用启停状态。