吉鑫升
fa70b31873
Merge remote-tracking branch 'origin/master' into ji
...
# Conflicts:
# frontend-web/src/components/workspace/input-box.tsx
# offline-backend-20260512/backend/CLAUDE.md
2026-06-16 11:07:31 +08:00
吉鑫升 and Claude Opus 4.8
3855c30edd
feat: 新增岗位管理、提示词模板与资源标签,完善用户提示词与推荐问题接口
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-16 10:49:36 +08:00
fengxiangdebaozi and Claude Opus 4.8
3907034a1d
feat(roundtable): 第二步席位执行模式(快速/思考/专业问答/多智能体)+ 子智能体任务卡片 + 后台完成跨页通知 + 链条默认模式持久化
...
- 席位执行模式:选择参会智能体弹窗加模式选择器,映射 thinking/reasoning/subagent
透传 recommend/chain/dag 三条编排;后端 _special_run 覆盖 seat policy(仅席位,
总控不变);ultra 解锁席位 task 子代理(custom 流回传 task_running 实时进度)。
- 子智能体任务卡片:复用主聊天 SubtaskCard + SubtaskContext,从席位流解析 task
调用/结果,在 Step2 气泡渲染多张任务卡片(覆盖业务链条路径)。
- 后台挂起也按所选模式跑(StartParams→inprocess gateway→run_seat 覆盖 policy)。
- 后台作业完成全工作区跨页通知:RoundtableJobNotifier 挂在 PageLayout 常驻层,
作业终态弹「达成共识」同款浮窗。
- 业务链条可配「默认执行模式」并持久化(roundtable_chains.seat_mode;选链时弹窗
默认用它,仍可临时改)。
- 修复后台 Step3 HTML 看板概率截断:deepseek max_tokens=4096 单轮写不完长 HTML,
产物自愈重试上限 2→5,让 append 续写写完整(同惠及 summary/dashboard)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-15 18:20:20 +08:00
董宏凯 and Claude Haiku 4.5
01012ff300
feat(settings): 轻应用登录参数与界面模式管理员默认
...
- 登录时从路由参数 yUserId/access_token 获取并存入 userInfo
- 轻应用管理页路由参数新增 userName/gateDepartName/typeName 选项
- 添加系统默认界面模式设置(管理员可指定全量/简洁)
- useLayoutMode hook 支持优先级:用户自选 > 管理员默认 > 会话级
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com >
2026-06-15 11:39:02 +08:00
董宏凯 and Cursor
c702119e66
feat(ui): 浅蓝主题、外观设置与圆桌看板主题适配,优化工作区布局
...
新增 lightblue 主题与外观设置联动,圆桌 Step3 看板/report 统一配色;工作区侧边栏、输入框与轻应用 iframe 主题参数同步更新。
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-14 12:43:16 +08:00
董宏凯 and Claude Opus 4.8
cd3a71baab
feat(agents): 内置智能体筛选(仅管理员)+ 内置 agent 默认用途标签
...
- 后端 scope=builtin(user_id IS NULL)加入 sql/memory 的 scope 过滤;
/api/agents 扩展 scope 正则并加 admin 闸门(非管理员请求 403)
- 新增 _builtin_agent_tag_seed:启动时幂等给功能型内置 agent 按用途打标签
(roundtable-* → 多智能体规划,ai-writing-* → AI写作),只追加不覆盖;
无用途的内置 agent 不打标签
- 前端 agent-gallery 新增「内置智能体」Tab(仅 system_role==admin 可见),
scope 类型在 api.ts/hooks.ts 同步
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-13 20:42:26 +08:00
董宏凯
146c8e76f0
@
...
feat(圆桌): 业务链条显示配置人 + 配置页拆两步并新增精美流程图
- 列表/弹窗卡片显示「配置人」(后端把 owner user_id 解析为 email,
ChainResponse 增 owner_id/owner_name,store 输出 owner_id)
- 配置编辑器拆为两步:第一步基本信息(描述改多行文本),第二步链条编排
- 第一步有编排内容时,左侧基本信息 + 右侧 ChainFlowDiagram 流程图:
直角连线、点节点开详情抽屉、连线显示阶段目标(依赖)、滚轮缩放、
拖动平移、全屏 + 全屏右下角缩略图
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
@
2026-06-13 15:32:37 +08:00
董宏凯
d5f319d9cb
@
...
feat(圆桌): Step3 三产物并行 + 大屏多页模式 + 后台挂起查看恢复流程
后台挂起 Step3:
- engine 总结报告/结果绘制/大屏数据 asyncio.gather 三流并行,故障隔离
- request.state 回归修复(进程内虚拟 request 补 state),恢复后台报告
- ROUNDTABLE_JOB_GATEWAY 默认 inprocess;产物自愈重试(截断/缺失纠偏)
- 大屏后端只产 report-json(dashboardJson),前端按当前主题渲染
结果绘制大屏多页模式(模式二):
- report-template 模板渲染(report-json→大屏HTML),零截断、主题跟随
- 与模式一同款交互(流式+沙箱+可修改);沙箱新窗口打开按钮
最终方案展示:左侧席位栏+总控头像、交付/文件合并、收展动画、内联沙箱
后台挂起查看=恢复实时流程:
- handleLoadDraft 返回 Promise,await hydrate 后订阅 streamJob SSE 跟随
- saveDraftNow 强制存(发起前+查看前各一次)防丢
第二步优化:总控判断串/并行(并行单列可写)、席位上下文+交付模板、
peerDeliveries、失败重试、共识标记、流程图小窗(缩放/拖动/并行批)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
@
2026-06-13 10:36:46 +08:00
董宏凯
f0c85c4795
后台挂起功能修改
2026-06-12 21:38:20 +08:00
Administrator
e74ef4b7dc
Merge branch 'ji' into master
2026-06-12 18:28:13 +08:00
Administrator
2862eee33b
chore: 提交本地修改
2026-06-12 18:09:07 +08:00
吉鑫升 and Claude Opus 4.8
229830ee89
feat: 智能体 md 产物一键发布到外部知识入库接口
...
- 智能体新增「入库模板名」(template_name) 配置,持久化到 config.yaml
并经 AgentCreate/Update/Response 回读(NewAgentPage / AgentDetailPanel)
- 新增 POST /api/knowledge-ingest/publish:把 md 标题+全文发到 knowes,
标题字段先「名称」失败再用同一 nodeName 换「标题」重试一次
- md 产物预览右上角新增「发布入库」按钮(仅智能体会话且配置了模板名时显示)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 16:38:04 +08:00
fengxiangdebaozi
9d73f27146
feat: light app center and iframe refactor
2026-06-12 15:40:09 +08:00
吉鑫升 and Claude Fable 5
57a87d6322
feat: MySQL 索引长度兼容 + 启动自动补列 + 未发布徽标与查询加载态
...
后端:
- 索引/唯一键改用 mysql_length 前缀索引,适配 MySQL 767 字节限制(error 1071):knowledge_notes、knowledge_entities、knowledge_graph_blacklist、agent_skills、feedback
- engine.py 新增 _ensure_orm_columns_sync:启动时对比 ORM 元数据,自动 ALTER TABLE 补齐缺失的可空/带默认值列及其索引
- 新增 scripts/audit_index_key_lengths.py 审计全部索引键长度
- 更新 backend/CLAUDE.md 迁移说明
前端:
- 智能体卡片/技能列表:所有者与管理员可见未发布徽标
- 智能体广场:服务端查询进行中时灰显旧结果并悬浮加载提示
- 排行榜入口从 Header 移到欢迎语旁
- threads/hooks.ts:抽取 updateCachedThreadLists 统一处理数组与分页两种缓存形态
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-12 14:51:50 +08:00
董宏凯
728a4b1170
Merge branch 'master' of http://192.168.0.200/knowledge-base-bj/deerflow-server into dhk-1
2026-06-12 14:10:08 +08:00
董宏凯 and Claude Fable 5
086c280e5d
圆桌第三步流程图模式 + 后台 DAG 任务编排
...
- 方案总结报告:用户要求结构化输出/流程图时跳过 md 直出 flow-json 流程图,
报告用文字展示;报告与流程图均可多轮修改、互相切换(detectFlowIntent 识别意图)
- 流程图画布放右侧沙箱位(sidePanel 插槽)不覆盖消息列表,可与 md 预览切换;
节点随容器宽度自适应缩放并 fitView 居中
- 后台挂起支持真 DAG 编排(分层并行/阶段目标/总控提示词),新增
orchestration_plan 持久化列 + 迁移;大弹窗流程图按 DAG 分层渲染
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-12 13:52:17 +08:00
吉鑫升 and Claude Fable 5
28098b3155
feat: 知识库实体筛选、技能白名单收紧、嵌入主题与提问组件优化
...
- 知识库笔记列表支持按实体精确筛选(路由/服务/仓储层透传,关系图索引查询)
- 自定义智能体技能白名单在 skill_view 与 skill_manage 的 list/view 别名上同样生效;
config 未声明 skills 时视为无可见技能
- 嵌入圆桌主题解析默认深蓝,强制主题期间不再写 localStorage 覆盖主站选择
- 智能体提问建议拆出 agent-question-chips 组件,编辑器与详情面板联动优化
- 新增 qa-client 问答测试脚本
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-12 11:09:32 +08:00
吉鑫升
11bc442f10
Merge branch 'ji' of http://192.168.0.200/knowledge-base-bj/deerflow-server into ji
2026-06-12 09:19:23 +08:00
Administrator
1b86373a54
feat: 知识库标签/实体关联跳转 + 会话重连容错
...
前端:
- Wiki 标签与实体改为可点击,弹出 RelatedNotesDialog 查看关联知识
- 知识库首次进入自动打开最近笔记,避免空白阅读区
- 流式重连识别 "Run not found",清理 sessionStorage 残留 key 并静默回退历史
后端:
- 线程鉴权区分 not found / not accessible,并支持 DB 切换产生的孤儿线程认领
- run 查询/join 在内存未命中时回退持久化存储,重启后返回干净的终止 SSE 而非 404
2026-06-11 23:19:09 +08:00
董宏凯 and Cursor
a4a9a4d26e
AI 写作四阶段内置智能体 Phase 1-4 落地
...
新增 ai-writing-researcher/outliner/writer/editor 种子 agent、_agent_runner 与 use_builtin_agents 灰度开关;四节点可按 flag 切换 SOUL 模式;时间线补大纲规划师配色并更新改造文档。
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-11 22:58:38 +08:00
吉鑫升 and Claude Fable 5
e7b51a30a3
fix: 智能体可见性对齐——列表可见即可打开问答,消除 404
...
get_visible 此前比列表过滤更严格(仅 内置/本人/已发布),导致私密广场
智能体(转私密强制 published=false)和「我的」里已收藏但被取消发布的
智能体能在列表看到、点开问答却 404(前端连带报 X.map is not a function)。
- AgentRepository._visible_filter / MemoryAgentStore._is_fetchable:
单条读取放宽为所有列表口径的并集(+is_private 豁免、+本人收藏豁免)
- 详情接口与 _enforce_agent_access 运行门禁:管理员回退 get_any,
对齐 ?admin=true 全量列表
- 普通未发布草稿对陌生人仍不可见,隐私不放开
- 本地新增 tests/test_agent_visibility.py 覆盖 SQL/Memory 双实现
(tests/ 目录在本仓库被 gitignore,不随提交)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-11 21:25:36 +08:00
吉鑫升
0b98d18483
Merge remote-tracking branch 'origin/master' into ji
2026-06-11 20:28:15 +08:00
吉鑫升 and Claude Fable 5
3d6f35391e
feat: 对话列表显示总数,SOUL 编辑区高度自适应收敛
...
- 新增 POST /threads/count:与 /threads/search 同一套过滤(标题搜索、
系统会话排除),仅返回 {total};ThreadMetaStore 增加 count 方法
(SQL 走 COUNT(*),JSON 过滤分批扫描计数)
- 对话页面搜索框下常驻显示「共 N 条对话」,分页条显示 当前页/总页数
(useThreadsCount,仅随筛选条件变化,翻页不重复请求)
- 智能体右侧 SOUL 预览改为 40vh 上限自适应展开(不再全部展开);
详情面板/卡片编辑/创建页的 SOUL 输入框统一为适中高度 + 可拖拽
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-06-11 20:26:44 +08:00
吉鑫升
82600a3404
Merge branch 'ji'
2026-06-11 19:59:58 +08:00
吉鑫升 and Claude Opus 4.8
f107ebc46d
feat: 完善知识图谱交互与 Agent/线程持久化
...
- 知识图谱画布、侧边栏、详情面板交互优化,新增图谱相关 API 与 hooks
- Agent 卡片与详情面板调整,对话页面重构
- 线程元数据持久化增强(base/memory/sql),knowledge 仓储与导出补充
- 网关路由 agents/knowledge/threads 同步更新
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 19:58:34 +08:00
董宏凯 and Cursor
bcc3d617a0
Merge branch 'ji' into dhk-1
...
Resolve column_additions_mysql.sql conflict: keep square_id columns from master and roundtable_drafts.task_id from dhk-1.
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-06-11 17:40:08 +08:00
董宏凯
f3ca996116
wujie应用联调
2026-06-11 17:11:28 +08:00
吉鑫升
5daa4b3e20
Merge remote-tracking branch 'origin/master' into ji
2026-06-11 16:39:30 +08:00
吉鑫升
80e84de868
Merge remote-tracking branch 'origin/hlh' into ji
2026-06-11 16:35:18 +08:00
xuhd
1668c1da87
Merge remote-tracking branch 'origin/master' into xuhd
...
# Conflicts:
# frontend-web/.env.production
# frontend-web/.env.sit
# frontend-web/package.json
# offline-backend-20260512/backend/config.yaml
2026-06-11 14:19:01 +08:00
xuhd and Claude Opus 4.8
b0e48b6bda
refactor(studio): 文案“我的笔记/笔记本”统一改为“我的空间”
...
涉及空间详情页、AI 写作表单/上下文/类型、researcher 注释及 env 注释。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 11:45:35 +08:00
吉鑫升 and Claude Opus 4.8
f0aec4cd7f
feat(square): 新增发布广场功能,智能体/技能按广场分类展示
...
- 后端新增 PublishSquare/PublishSquaresSettings 配置与读写接口
- agents/skills 增加 square_id 字段及对应迁移脚本
- 前端新增发布广场设置页、技能转移选择器,画廊按广场分 Tab 展示
- lead_agent prompt 及若干持久化层适配调整
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 11:37:42 +08:00
xuhd
82d14351fc
修改名称 笔记本改为 空间
2026-06-11 11:19:26 +08:00
吉鑫升 and Claude Opus 4.8
3845d5090b
feat(knowledge): 支持文件导入沉淀知识,知识图谱可视化随主题切换
...
- 后端新增 /api/knowledge/ingest/file:上传 md/txt/pdf/word/ppt/excel,
转 Markdown 后走 wiki-capture LLM 蒸馏为陈述式知识笔记,失败回退逐字草稿
- service.capture_file + 文档专用蒸馏提示词,按主题拆分 1~4 页
- 知识图谱导出 HTML 支持 ?theme=light|dark,布局稳定后冻结,
按度数缩放节点,悬停/点击聚焦邻居
- 前端知识库页新增「导入文件」对话框与 ingestKnowledgeFile API
- 智能体问答页与简介侧边栏 UI 优化;批量人物蒸馏脚本提取正文逻辑修正
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 10:25:27 +08:00
Administrator and Claude Opus 4.8
e97017b297
feat(agents): 智能体常用问题——侧边栏展示并一键提问
...
新增 common_questions(常用问题)字段:后端贯通 agents_config、
config.yaml 读写与 create/update API,前端 Agent 类型补充字段并在
AgentChatPage 新增 AgentInfoSidebar 组件展示常用问题,点击即填充并提交。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 08:34:39 +08:00
Administrator
7fb3870247
@
...
feat(summarization): 非破坏性上下文压缩——保留原始对话仅在请求时瞬态压缩
重写 DeerFlowSummarizationMiddleware:将 stock before_model 的
RemoveMessage(REMOVE_ALL_MESSAGES) 改为 no-op,改在 wrap_model_call 中
瞬态压缩为 [summary, *recent],完整原始对话仍保留在 state 中,前端继续
渲染用户真实问答。summary 消息标记 hide_from_ui 且永不持久化,按 thread
缓存以避免每次模型调用都触发 LLM。前端 isHiddenFromUIMessage 额外隐藏旧
版本持久化的 name="summary" 消息。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
@
2026-06-11 08:34:09 +08:00
xuhd
06508cfb7c
Merge remote-tracking branch 'origin/master' into xuhd
2026-06-10 17:15:51 +08:00
吉鑫升 and Claude Opus 4.8
413f92e270
fix(migrations): 合并 alembic 多头(skill_name_zh 与 chain-stages 分支)
...
20260609_01(skills.name_zh)直接挂在 20260608_01 之下,与
20260608_02..06(chain-stages/parallel-agent 分支)形成两个 head,导致
`alembic upgrade head` 报 Multiple head revisions。新增空 merge 版本
20260609_02 同时指向 20260608_06 与 20260609_01,使 head 归一。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 14:39:37 +08:00
xuhd
b8d3a549df
buggggg
2026-06-10 11:27:48 +08:00
吉鑫升 and Claude Opus 4.8
d61aa853f1
feat(admin): 用户排行榜每日快照——手动刷新当天 + 凌晨自动定稿前一天
...
- 新增 POST /api/admin/users/leaderboard/refresh-today:同步强制重建当天快照
并返回合并区间;前端 useRefreshTodayLeaderboard + AdminUserLeaderboardPage
「刷新当天」按钮
- Gateway 调度循环在每日 ADMIN_LEADERBOARD_FINALIZE_HOUR(默认凌晨1点)对前一天
强制重算一次,避免临近午夜落库的 runs/tool-calls 漏统计;判定逻辑下沉为纯函数
deerflow.persistence.admin_stats.finalize.should_finalize_previous_day
- 新增 scripts/sql/column_additions_mysql.sql:既有 MySQL 库手动补列的幂等脚本
(Alembic 自动迁移已禁用,create_all 不改既有表)
- CLAUDE.md 补充排行榜快照、Schema 迁移约定,并补齐技能/知识库选模型的文档
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 11:24:21 +08:00
吉鑫升 and Claude Opus 4.8
96e0d695c0
feat(skills,knowledge): 中文名补全与知识库沉淀支持可选大模型并明确大模型报错
...
技能中文名:
- 单个「AI 生成」与「一键补充中文名」均可在请求体 model_name 选择大模型
- 一键补充改为仅管理员开放
- _generate_skill_name_zh 在模型自身失败(构建/超时/API 报错)时抛
SkillNameZhModelError,与模型返回无效名称区分;单个接口返回
502「大模型报错,无法补全技能中文名」,批量在 model_error 中带回代表性报错
知识库沉淀:
- 对话保存到知识库 / 批量导入均新增可选 model_name(透传至 capture_thread
→ extract_thread_llm_multi)
- 批量返回 llm_fallback 计数;模型异常时仍按既有逻辑回退规则抽取并落草稿,
前端明确提示「已改用规则抽取」(保存按钮保持后台异步)
前端新增 components/workspace/model-name-select.tsx 复用下拉(默认=系统配置模型)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 11:23:01 +08:00
Administrator
87e0ae683e
Merge remote-tracking branch 'origin/master' into ji
...
# Conflicts:
# offline-backend-20260512/backend/app/gateway/app.py
# offline-backend-20260512/backend/config.yaml
# offline-backend-20260512/backend/packages/harness/deerflow/persistence/models/__init__.py
# offline-backend-20260512/backend/packages/harness/deerflow/runtime/checkpointer/async_provider.py
2026-06-10 09:09:26 +08:00
Administrator and Claude Opus 4.8
44c0f6189b
wip: 合并 master 前暂存本地改动
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 08:36:47 +08:00
Administrator and Claude Opus 4.8
1ce15fbb15
style(knowledge): 实体改回纯展示(不可点击),chip 精致化
...
按需求去掉点击筛选,实体为静态彩色 chip:色点 + 名称 + 胶囊型类型标签。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-09 20:34:59 +08:00
Administrator and Claude Opus 4.8
f6af9379b7
feat(knowledge): 笔记页实体可点击筛选 + chip 美化
...
- 实体改为按钮:点击即在左侧列表筛出提及该实体的知识(清空来源/状态筛选)
- chip 加阴影/hover 上浮/类型 ring 标签/实体区 Sparkles 图标,更精致
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-09 19:48:20 +08:00
fengxiangdebaozi
cba165933c
提交代码
2026-06-09 17:18:40 +08:00
xuhd and Claude Opus 4.7
e54f42c0eb
fix(skill_manage): refuse agent writes to human-authored skills
...
Even after the previous owner check, the agent could still patch/edit
a UI-uploaded skill (source=upload) it happened to own. Uploaded skills
represent human-reviewed content; letting the agent rewrite them risks
silent drift from what the user approved.
Add _assert_skill_is_agent_authored which reads usage.json and refuses
unless source==agent. Wired into all five write actions
(create/edit/patch/delete/write_file/remove_file). Skills with no usage
entry default to source=upload, so legacy and adopted-orphan skills are
also refused — only skills the agent created via mark_agent_created in
the create flow stay editable.
Note: this check is independent of skill_store availability (it reads
the usage file, not the DB), so it runs even when skill_store is None.
Tests that exercise non-create paths against pre-existing skills will
need to call mark_agent_created first or mock get_entry.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-06-09 16:00:44 +08:00
xuhd and Claude Opus 4.7
c493639119
feat(skill-review): strict-mode prompt + raise min_tool_calls 3 to 5
...
The review agent was creating too many low-value skills. Three changes
tighten the funnel:
- review_worker prompt: rewritten in "保守模式". Default decision is
do-nothing. To create, all five AND conditions must hold (>=5 tool
calls with step dependencies, an explicit fail->fix->success episode,
cross-scenario reusability, no >=70% overlap with skill_list, can
produce >=300 chars of substance). Adds 7 explicit NO categories
(single-tool loops, one-off queries, LLM common knowledge, etc.)
and a 4-question self-check before any create. Hard cap of 1 new
skill per review, with patch preferred over create.
- min_tool_calls: 3 -> 5. Matches the prompt's ">=5 steps" hard
condition so trivial turns never reach the LLM reviewer.
- Updated config.yaml, the default-value assertion in
test_skill_review_worker, and the middleware docstring's "(default
3)" annotation to keep all three references in sync.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-06-09 16:00:29 +08:00
xuhd and Claude Opus 4.7
539a8bcec8
fix(skill_manage): block cross-user writes on patch/edit/write_file/remove_file
...
Only delete had a DB owner check via _assert_agent_may_delete. The other
four write actions only called ensure_custom_skill_is_editable, which
just verifies the directory exists under skills/custom/ — it does not
check owner_user_id. Any agent that knew a skill's name could overwrite
or strip support files from another user's UI-uploaded skill.
Generalise the helper to _assert_agent_may_modify (same three rules:
no DB row / built-in owner=None / owner mismatch) and call it from
edit, patch, delete, write_file, and remove_file. Hoist user_id +
skill_store to the top of the lock block so the four newly-guarded
branches stay one-liners and create/delete reuse the same handles.
Behaviour preserved when skill_store is None (no DB) — matches the
existing delete fallback.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-06-09 15:49:26 +08:00
xuhd
bd0eceda61
Merge remote-tracking branch 'origin/master' into xuhd
...
# Conflicts:
# offline-backend-20260512/backend/config.yaml
2026-06-09 15:43:40 +08:00