xuhd and Claude Opus 4.7
d592e1e535
fix(skills): curator 自我进化周期调度 + 并发/配置/安全修复
...
调度:
- app.py 新增常驻 curator 调度器,每小时检查一次"需不需要进化",
替代原来"仅启动跑一次";多 worker 下用跨平台文件锁做 leader 选举,
只有一个进程跑调度;启动延迟 5 分钟避开启动高峰
curator 逻辑修复:
- C1: should_run_now / apply_automatic_transitions / get_curator_status
调用 _get_curator_config 时传 user_id,使 per-user 配置在运行时生效
- C3: usage.py 的 .usage.json 读-改-写加进程内锁,bump_* 改回调式,
避免 curator 多线程并发丢状态更新
- C4a: curator 受限版 skill_manage 在工具层屏蔽 delete,
堵住绕过 skill_archive 安全网删技能的口子
- C4b: 进化记录同时保存 LLM 自述(suggestions)与真实工具调用(actual_actions)
- 无候选技能时跳过 LLM 评审,省掉无意义的模型调用
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 19:31:05 +08:00
xuhd
e381e9f52e
222
2026-05-15 18:00:11 +08:00
吉鑫升
3b951efd13
Merge remote-tracking branch 'origin/master' into ji
2026-05-15 16:54:56 +08:00
吉鑫升
33161c5bad
Merge remote-tracking branch 'origin/likun' into ji
...
# Conflicts:
# frontend-web/src/components/workspace/artifacts/artifact-file-detail.tsx
# frontend-web/src/components/workspace/code-editor.tsx
# frontend-web/src/components/workspace/input-box.tsx
# frontend-web/src/pages/ChatPage.tsx
# offline-backend-20260512/backend/app/gateway/routers/artifacts.py
2026-05-15 16:54:10 +08:00
xuhd
8b6236c796
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into xuhd-v2
2026-05-15 16:42:48 +08:00
xuhd and Claude Opus 4.7
a59d80d7f3
feat(i18n): 全局将「专家」文案改为「智能体」
...
统一智能体功能的 UI 文案:侧边栏、智能体页、新建/保存流程、
审批卡片、登录提示及后端审批消息中的「专家」均改为「智能体」。
保留 prompt 人设、QA 子应用等非该功能语义的「专家」表述。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 16:42:40 +08:00
xuhd and Claude Opus 4.7
a5c76591ac
feat(i18n): 全局将「专家」文案改为「智能体」
...
统一智能体功能的 UI 文案:侧边栏、智能体页、新建/保存流程、
审批卡片、登录提示及后端审批消息中的「专家」均改为「智能体」。
保留 prompt 人设、QA 子应用等非该功能语义的「专家」表述。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 16:42:11 +08:00
xuhd
c2a975af9e
@
...
feat(i18n): 全局将「专家」文案改为「智能体」
统一智能体功能的 UI 文案:侧边栏、智能体页、新建/保存流程、
审批卡片、登录提示及后端审批消息中的「专家」均改为「智能体」。
保留 prompt 人设、QA 子应用等非该功能语义的「专家」表述。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
@
2026-05-15 16:41:44 +08:00
xuhd
ab48cd5b55
111
2026-05-15 16:36:02 +08:00
吉鑫升 and Claude Opus 4.7
ed4909a28d
chore: 纳入 skill_evolution 运行时配置文件
...
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 16:29:26 +08:00
吉鑫升
afc517b3a7
Merge remote-tracking branch 'origin/master' into ji
...
# Conflicts:
# frontend-web/src/components/workspace/agents/agent-gallery.tsx
# frontend-web/src/components/workspace/settings/skill-settings-page.tsx
2026-05-15 16:27:56 +08:00
likun
de9f6b6711
feat: 新增写作画布系统
2026-05-15 16:22:04 +08:00
吉鑫升 and Claude Opus 4.7
646cb8caeb
feat: 标签管理功能 + 问答前缀对用户隐藏
...
标签管理:
- 新增 tags/tag_assignments 持久化层、迁移、/api/tags 路由
- 标签分智能体/技能/定时任务三类, 仅同类型可互打, 仅 admin 可增删改与打标签
- 三类资源列表支持按名称模糊检索与按标签筛选(走后端查询参数)
- 前端新增标签管理页、TagPickerDialog(点击即时绑定)、彩色标签 chip
问答前缀:
- 前缀不再拼入消息 content, 改存 additional_kwargs 由 PromptPrefixMiddleware
在调模型前临时注入, 用户界面看不到前缀但模型仍收到
- 修正 thread_existed 闸门导致首轮前缀被跳过的问题
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 16:19:08 +08:00
likun
d533ddde88
feat: 补充知识库内容p4
2026-05-15 16:17:55 +08:00
xuhd and Claude Opus 4.7
9664cb653a
feat(frontend): 记忆从设置弹窗移至侧边栏独立入口
...
- 新增 MemoryPage 及路由 /page/workspace/memory
- 侧边栏在「技能」下方新增「记忆」入口
- 设置弹窗注释掉「记忆」标签页
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 15:47:49 +08:00
xuhd
1574d44cc3
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into xuhd
2026-05-15 15:26:16 +08:00
xuhd and Claude Opus 4.7
6981fc06ca
feat(skills): 点击技能展示 SKILL.md 详情弹窗
...
- 后端新增 GET /api/skills/{name}/content 接口,返回公共/自定义技能的 SKILL.md 原文
- 前端技能行内容区可点击,弹窗以等宽原文展示 SKILL.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 15:23:34 +08:00
xuhd and Claude Opus 4.7
12798c00bc
feat(frontend): 设置弹窗移除「技能」标签页
...
技能管理已有侧边栏独立入口(/page/workspace/skills),设置弹窗内的入口冗余,移除。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 15:10:43 +08:00
xuhd and Claude Opus 4.7
ebb6be816b
feat(frontend): 技能/专家广场展示调整 + 通知合并入设置菜单
...
- 技能与专家「广场」标签只展示内置和已发布项,Tab 顺序调为「我的」在前并默认选中
- 「智能体」全量更名为「专家」
- 通知由侧边栏铃铛改为「设置和更多」菜单内的弹窗入口,合并通知列表与通知设置
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 15:08:56 +08:00
likun
ae4e4f67c2
新增大模型知识库技能
2026-05-15 14:51:16 +08:00
xuhd and Claude Opus 4.7
013aafde17
feat(frontend): 记忆页面迁移到 Memory V2
...
前端记忆模块整体迁到后端 Memory V2 接口,修复调旧端点 /api/memory
返回 404 的问题。
- core/memory/{types,api,hooks}.ts 重写为 V2 数据模型与端点
(USER.md / MEMORY.md 条目增删改、配置读写、Hindsight 检索)
- memory-settings-page.tsx 重写:用户画像 + 工作笔记两区的条目
增删改、记忆设置面板(白名单字段)、Hindsight 检索面板
- 工作笔记按专家隔离,顶部专家下拉(默认助手 + useAgents 列出的
用户专家),专家列表取自 agents 注册表
- settings-dialog 记忆分区移到技能下方
- i18n(zh-CN/en-US/types)memory 文案整体替换
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 14:14:08 +08:00
董宏凯
050b1ad78e
代码提交
2026-05-15 14:08:01 +08:00
xuhd and Claude Opus 4.7
21a76f5e7c
refactor(memory): Memory V2 P3 - 舍弃后台抽取 + Gateway 端点收口
...
P3 在 P1/P2 基础上完成 Memory V2 收尾:
舍弃后台抽取:
- 删除 updater/queue/storage/prompt/summarization_hook 五个模块
- 移除 background_extraction 配置段、扁平字段兼容、storage 字段
- 理由:Hindsight auto_retain 已自动留存每轮对话,后台抽取冗余
Hindsight 召回注入改用 wrap_model_call:
- 由 before_model 改为 wrap_model_call —— 召回只注入单次模型请求、
不落持久 state,从根上消除 <memory-context> 泄漏给前端的风险
- builtin frozen snapshot 仍走系统提示词
Gateway 端点收口为 /api/memory/v2*:
- 删除旧 facts/history 端点 (/api/memory、/memory/facts 等)
- 新增 entries 增删改 (POST/PUT/DELETE /memory/v2/entries)
- 新增 POST /memory/v2/search —— Hindsight recall/reflect 检索代理
- client.py memory 方法重写为 V2 等价方法
文档同步更新 CLAUDE.md 与 MEMORY_V2_DESIGN_ZH.md。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 13:08:18 +08:00
xuhd and Claude Opus 4.7
f9d7610679
feat(memory): Memory V2 重写 - 可插拔 provider + Hindsight 集成
...
以 Hermes 的可插拔记忆架构为骨架重写 deerflow 记忆模块,兼容原有
结构化数据,并新增 Hindsight 作为外部记忆后端。
P1 - 抽象层 + builtin 本地记忆:
- MemoryProvider 抽象基类 + MemoryManager 编排层(builtin + ≤1 外部)
- BuiltinFileProvider:USER.md/MEMORY.md 二元存储、字符配额、文件锁、
原子写、frozen snapshot
- memory 工具(LangChain @tool):LLM 主动写入用户画像/工作笔记
- 记忆内容安全扫描(注入/外渗模式 + 不可见 unicode)
- memory_config 改为嵌套结构 + 旧扁平字段兼容 + per-user 三层覆盖
- 迁移脚本 migrate_memory_to_v2.py:旧 memory.json -> USER.md/MEMORY.md
- Gateway 新增 /api/memory/v2 与 v2/config 端点(用户可配置白名单字段)
P2 - Hindsight 外部 provider:
- HindsightProvider:双 bank 隔离(user bank 跨 agent 共享 + work bank
agent 私有)、并发召回合并、auto-retain、on_memory_write 镜像
- hindsight_recall/reflect/retain 三个 LangChain 工具
- MemoryMiddleware.before_model 注入 Hindsight 动态召回
- context/tools/hybrid 三种 memory_mode
- hindsight-client 作为可选依赖,未装时自动退回纯 builtin
注入走系统提示词(builtin frozen snapshot)+ before_model(Hindsight
动态召回)。后台抽取保留但默认关闭,P3 期重接入。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 12:15:55 +08:00
吉鑫升
aeba15eb16
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into ji
...
# Conflicts:
# frontend-web/src/pages/WorkspaceRoutes.tsx
# offline-backend-20260512/backend/packages/harness/deerflow/persistence/models/__init__.py
2026-05-15 11:21:48 +08:00
董宏凯
b81f64a253
Merge branch 'dhk-2' into 'master'
...
Dhk 2
See merge request knowledge-base-bj/deerflow-server!16
2026-05-15 02:43:25 +00:00
fengxiangdebaozi
a0d04cba50
文档修改
2026-05-15 10:42:44 +08:00
xu hd
43bdbcf89c
Merge branch 'xuhd' into 'master'
...
feat(skills): 自我进化后端 — curator 配置可编辑 + 运行日志可读
See merge request knowledge-base-bj/deerflow-server!15
2026-05-15 01:36:33 +00:00
xuhd and Claude Opus 4.7
6947a3ffa7
chore(tests): ignore tests/ 目录 + 同步现有测试到新 skill_archive 签名
...
- .gitignore: 新增 offline-backend-20260512/backend/tests/* 规则,
让后续新增的测试文件不再误进入版本控制
- test_skills_multitenancy.py: 同步上次 feat(skills) 提交里
skill_archive(name, reason) 必填 reason 的签名变更
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 00:03:07 +08:00
xuhd and Claude Opus 4.7
62d525dae7
feat(skills): 自我进化 - 软归档/恢复 + Agent 归属 + 状态分层 UI
...
后端:
- 新增 PUT /api/skills/custom/{name}/state 与 /pinned 软归档/恢复 + 钉选 API
- skill_manage 工具: agent 创建写 DB 归属; 删除清理 .usage.json + DB row + cascade 引用; 加 ownership 预校验
- curator 全部软归档(文件保留在 custom/), 加 reason 必填(中文), 修 user_context 跨线程传播 / 协程泄漏 / archive 文件不再移动
- LLM 评审接 ToolErrorHandlingMiddleware, 工具异常自动重试不中止本轮; 替换 create_react_agent 为 create_agent
- skill_list 按当前 agent config.yaml 的 skills 字段过滤(custom agent), lead agent 仍可见全部
- 自我进化提示词对齐 Hermes 风格: 主动询问保存, reason 强制中文且面向用户
- 控制台日志增强: 自动归档/标过时/LLM 合并/删减建议 都按条目输出原因
前端:
- 技能管理页 Tab 改「全部 / 我的」, 正确包含他人发布的 custom 技能(修复 isCustom 互斥 bug)
- 新增「过时 N / 归档 N」右侧抽屉(恢复/查看/立即归档 ⋯ 菜单)
- 新增徽章: 钉选 / 来源(Agent 创建 / 用户上传) / 使用次数展示
- 内置技能徽章修复(原 isBuiltin && isCustom 永远 false)
- 自我进化日志 run_started sentinel 在前端展示为中文分隔条
- 移除冗余 enabled 开关(归档已覆盖此能力, 减少术语)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-15 00:00:52 +08:00
xuhd
f8bc74b27f
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into xuhd
2026-05-14 23:45:10 +08:00
董宏凯
044370f13c
沙箱内容可保存
2026-05-14 22:12:20 +08:00
xuhd
a2c45492cb
2222
2026-05-14 20:45:22 +08:00
xuhd
9a67ca7c03
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into xuhd
2026-05-14 20:45:02 +08:00
xuhd and Claude Sonnet 4.6
40cd8a24af
feat: admin skill public upload + user management page
...
- Admin users can choose to install skills to public (built-in) or custom category via UI radio selector in InstallSkillDialog
- Backend: SkillStorage.ainstall_skill_from_archive accepts target_category param; non-admin 403 on public install
- Backend: AgentStore/SkillStore add count_owned(user_id); UserRepository/LocalAuthProvider add list_users()
- Backend: GET /api/v1/auth/users endpoint (admin-only) returns all users with skill_count and agent_count
- Frontend: admin-only "用户管理" nav item in sidebar; /page/workspace/admin/users route with user table
- i18n: added sidebar.users and adminUsers section in zh-CN/en-US
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-14 20:40:23 +08:00
吉鑫升 and Claude Sonnet 4.6
28948975db
Merge: 解决 ScheduledTaskRunDetailPage 合并冲突
...
保留 HEAD 的编辑功能 import(useCallback、Edit3、Loader2、Save、X),
同时采用 b78672 中的 useRouteNavigate 自定义导航 hook。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-14 19:29:35 +08:00
fengxiangdebaozi
1ce1db9689
代码处理
2026-05-14 19:28:07 +08:00
fengxiangdebaozi
86cdeed6ef
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into dhk-2
2026-05-14 19:26:01 +08:00
fengxiangdebaozi
d6ec0afbd6
路由嵌套修改
2026-05-14 19:25:39 +08:00
吉鑫升
3ea33e1dee
大模型速度增加提示
2026-05-14 19:12:14 +08:00
xuhd and Claude Opus 4.7
3e6e3c08d5
feat(skills): curator 三条件过滤 — agent 创建 + 未发布 + 无引用
...
Curator 之前只过滤 source=='agent',导致两类 skill 仍会被自动归档:
1. owner 已 published 的 skill(user B 在用,结果被 curator 收走)
2. 加进 agent.skills 但 .usage.json 活动不够频繁的 skill
新规则:curator transitions 和 LLM 合并候选**只**作用于同时满足
三条件的 skill —— source=='agent' + published==False + 不被任何
agent.config.yaml 的 skills 字段引用。
curator.py
- 新 helper _collect_referenced_skill_names():扫所有
.deer-flow/agents/*/config.yaml 把 skills 字段聚合成 set,一次
curator run 内只调一次
- 新 helper _is_skill_published(name):通过 SkillStore 查 published
状态,失败时返回 False(保守降级到旧行为)
- 新 helper _eligible_for_curation(name, entry, owned_set, referenced_set)
三条件合一判定
- apply_automatic_transitions 应用三条件过滤;返回的 counters 加
skipped_referenced / skipped_published 计数
- _render_candidate_list 应用同一过滤,LLM 看不到 protected skill
- _make_skill_archive_tool safety net:即使 LLM 编造名字调 archive,
工具内部再做一次"被引用 + published"检查,违规拒绝并记 warning
测试 tests/test_skills_multitenancy.py 新增 5 用例:
- test_curator_skips_skill_referenced_by_any_agent
- test_curator_skips_published_skill
- test_curator_archives_orphan_unpublished_skill
- test_skill_archive_tool_refuses_referenced_or_published
- test_collect_referenced_skill_names_aggregates_from_disk
跑测试:tests/test_skills_multitenancy.py 17/17,全套 36/36 全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 18:49:22 +08:00
xuhd and Claude Opus 4.7
6155a2ec2b
fix: curator + notifications react-query cache 按 user_id 隔离
...
切换账号在同一 tab 里时,旧 cache key (["curator","config"] 等) 会
让新账号"看到"上一个账号的值。如果用户没意识到、直接点保存,就会
把上一个账号的配置原样写到新账号的 per-user JSON 里去。
修复:在 useCuratorKeys / useNotificationKeys hook 里读
getStoredAuth().user_id 织进 queryKey。每个用户拥有独立 cache
桶,切换账号绝不命中对方的数据。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 18:20:41 +08:00
董宏凯
4e0787ec77
Merge branch 'dhk-2' into 'master'
...
页面接口整体修改
See merge request knowledge-base-bj/deerflow-server!14
2026-05-14 10:14:39 +00:00
fengxiangdebaozi
8ecc32da6d
页面结构修改
2026-05-14 18:13:58 +08:00
xuhd and Claude Opus 4.7
eb41da78f2
fix: 四处 router.push 缺 /page 前缀导致 404
...
HashRouter 顶层路由是 /page/*,所有 workspace 子路由必须带这个前缀
才能命中。以下四处 router.push 字面量遗漏,点击后落到 NotFoundPage:
- skill-evolution-panel.tsx 返回技能按钮
- NewAgentPage.tsx 返回 agents
- NewAgentPage.tsx 创建后“开始对话”
- agent-card.tsx 列表卡片“聊天”按钮
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 17:56:32 +08:00
xuhd and Claude Opus 4.7
a508969331
chore: 忽略 skill_evolution.json 运行时文件
...
前端 PUT /api/curator/config 会把 per-user 覆盖写到
backend/skill_evolution.json(全局 fallback),属于运行时
数据不该入库。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 17:46:36 +08:00
xuhd and Claude Opus 4.7
99febda256
feat(skills/notifications): 多租户阶段 4 — 测试 + 前端
...
后端:
tests/test_skills_multitenancy.py(12 个用例,全部通过)
- SkillStore: 可见性 / 全局重名拒绝 / owner-only update+delete /
admin override / ensure_legacy 仅补 NULL owner
- 路由助手 _get_editable_skill_or_raise / _get_owned_skill_or_raise
的 owner / admin / 403 / 404 分流
- cascade_skill_unpublished_or_deleted:
· unpublish 同时扫两个用户的 agent,剥掉 skill;自己改自己不发
通知,其他人收 agent_skill_removed
· admin_takedown 额外给 skill owner 发 skill_taken_down
- NotificationStore CRUD + unread_count + 跨用户隔离
- 同步版 apply_automatic_transitions 用户隔离:A 跑 curator 不
动 B 的 skill;curator_log per-user 分桶
前端 — core/notifications/{types,api,hooks,index}.ts
- 类型对齐 routers/notifications.py 的 NotificationItem
- listNotifications / getUnreadCount / markRead / markAllRead /
deleteNotification
- useNotifications / useUnreadCount(refetchInterval=30s) / mutation 钩子
前端 — components/workspace/notification-bell.tsx
- 顶部铃铛图标 + 未读红点(>99 显示 99+)
- 复用 DropdownMenu 作为弹层(项目暂无 Popover 原语)
- 列表项:未读蓝点 + 标题 + body + 相对时间,悬停露出删除按钮
- 标记单条已读 / 全部已读 / 删除
- 接入 workspace-nav-menu.tsx,作为 SidebarMenuItem 放在设置入口上方
前端 — Skill 多租户字段
- core/skills/type.ts 加 owner_user_id / published / builtin
- core/skills/api.ts 加 setSkillPublished + deleteCustomSkill
- core/skills/hooks.ts 加 useSetSkillPublished + useDeleteCustomSkill
前端 — settings/skill-settings-page.tsx
- 抽出 SkillRow 子组件,每项渲染 owner badge(内置/我的/来自他人/
已发布),样式抄自 agent-card.tsx 的 isBuiltin/isOwned/isFromOthers
- canManage = isOwned || isAdmin;canTogglePublish 同上但排除内置
- 发布/取消发布按钮(Eye / EyeOff),调用 setSkillPublished
- 删除按钮 + 二次确认 Dialog,调用 deleteCustomSkill
- 启用开关保持原样
前端 — i18n
- types.ts: 新增 NotificationsTranslations + Translations.notifications;
settings.skills 加 badgeBuiltin/badgeMine/badgeFromOthers(+Title) /
badgePublished(+Title) / publishAction / unpublishAction /
publishSuccess / unpublishSuccess / deleteAction / deleteConfirm /
deleteSuccess
- zh-CN.ts / en-US.ts 同步补齐对应文案
验证
- PYTHONPATH=. uv run pytest tests/test_skills_multitenancy.py -v →
12 passed in 2.08s
- 与现有 test_agents_backend / test_skill_evolution_runtime /
test_skills_install_upload 并行跑:41 通过 + 1 个 pre-existing 失败
(test_validate_rejects_missing_skill_md 期望 "SKILL.md" 但收到
"Skill archive is empty",与本期改动无关)
- pnpm typecheck:本次新增/修改的文件零新增错误;剩余报错全部为
pre-existing 的 next/link、next/navigation 别名声明缺失、
workspace-nav-menu.tsx 的 SettingsSection 类型不匹配、nextra
缺失、markdown-docx 第三方库等
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 17:35:02 +08:00
fengxiangdebaozi
543d78e040
路由调整
2026-05-14 17:24:45 +08:00
xuhd and Claude Opus 4.7
4ef96c7930
feat(skills): 多租户阶段 3 — Curator + 配置 per-user
...
curator_log.py
- ring buffer 从单一 deque 改为 dict[user_id -> deque],每个用户
自己的运行日志互不可见
- start_new_run / record / get_recent / clear 全部接 user_id
关键字参数;未传时落入 __default__ 桶兼容旧调用
- 新增 clear_all() 用于跨用户清理(仅测试用)
curator.py
- 状态文件路径从 skills/.curator_state 改为
.deer-flow/users/{user_id}/.curator_state(per-user 隔离)
- 所有公开 API 接受 user_id 参数:should_run_now /
apply_automatic_transitions / _render_candidate_list /
run_curator_review / _curator_thread_target /
get_curator_status / _make_skill_archive_tool / _run_llm_review
- 新增 _list_user_owned_skill_names(user_id):通过 SkillStore
查询当前用户拥有的 skill 名集合,用于过滤 transitions / LLM
candidates,保证 user A 跑 curator 不会动 user B 的 skill;
SkillStore 不可达时退化为"全部 agent-created skill"(兼容旧部署)
- _get_curator_config(user_id) 通过 load_skill_evolution_config_for_user
叠加 per-user override,让阈值/间隔/moderation_model 也是 per-user
- maybe_run_curator 启动时枚举 UserRow,按用户检查 should_run_now
并各起一个 daemon 线程跑
skill_evolution_runtime.py
- 全局 backend/skill_evolution.json 语义保留作为 fallback
- 新增 per-user API:resolve_user_path / load_user_overrides /
save_user_overrides / get_user_overrides_mtime,文件落到
.deer-flow/users/{user_id}/skill_evolution.json
- 新增 load_skill_evolution_config_for_user(user_id):读全局
SkillEvolutionConfig 作为 baseline,浅合并 per-user JSON,
返回 Pydantic 实例。验证失败时回落到 baseline
routers/skills.py
- /api/curator/status / run / config GET+PUT / logs 全部接
_current_user_id 注入运行上下文
- update_curator_config 改为 per-user:保存到
users/{user_id}/skill_evolution.json,不再 reset_app_config
- _build_curator_config_response 接受 SkillEvolutionConfig 实例
(而不是 AppConfig)以适配 per-user 合并结果
旧 19 个测试继续通过;未引入新依赖。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-14 17:09:05 +08:00
fengxiangdebaozi
7a7c99f752
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into dhk-2
2026-05-14 16:51:58 +08:00