docs: README 补 agent 通用能力对齐章节(memory/manage_skill/process/subagent + 记忆多租户 + required字段)

This commit is contained in:
yumoqing 2026-09-10 17:43:33 +08:00
parent 62c39ffe3f
commit 43f3ad48e5

View File

@ -20,6 +20,7 @@
| sd_projects | 软件项目定义(2026-09-10 自 pipeline-sdlc 迁入,跨产线共享) | | sd_projects | 软件项目定义(2026-09-10 自 pipeline-sdlc 迁入,跨产线共享) |
| sd_project_role_models | 项目角色模型配置(同上迁入;下拉 codes 指 sd_role 字典 + llm_model(status=active)) | | sd_project_role_models | 项目角色模型配置(同上迁入;下拉 codes 指 sd_role 字典 + llm_model(status=active)) |
| pipeline_deliverables | 产线交付物(同上迁入;主要写入方 pipeline-bidding) | | pipeline_deliverables | 产线交付物(同上迁入;主要写入方 pipeline-bidding) |
| pipeline_user_memory | 跨会话持久记忆(2026-09-10 多租户:加 org_id/user_id 归属列,key 掺租户维度,迁移 m0023) |
## 跨产线共享资源(wwwroot/api/) ## 跨产线共享资源(wwwroot/api/)
@ -59,3 +60,29 @@ wwwroot/pipeline_core -> ../pkgs/pipeline_core/wwwroot
`_general/{uid}` 专属目录,与 AgentExecutor 的文件根一致 `_general/{uid}` 专属目录,与 AgentExecutor 的文件根一致
(_resolve_ws_path 越界保护只认该目录) (_resolve_ws_path 越界保护只认该目录)
- `wwwroot/api/agent_chat_generic.dspy`:纯通用会话入口(generic=True) - `wwwroot/api/agent_chat_generic.dspy`:纯通用会话入口(generic=True)
## agent 通用能力对齐 Hermes(2026-09-10)
把 Hermes Agent 的「写入侧/运行时侧」能力补齐给产线会话 agent,GENERAL_TOOLS
从 25 个扩到 29 个,新增四工具(定义在本模块 `agent_config.py`,handler 在
pipeline-service `agent_loop_v2.py`):
| 工具 | 能力 | 隔离/门禁 |
|---|---|---|
| `memory` | add/list/remove 持久记忆(对齐 Hermes memory) | 多租户写入门禁在 handler:只能写 user/project/pipeline 域(global/org 种子域禁写),org_id/user_id 强制注入会话真实身份(忽略 LLM 传值),无身份拒写,remove 仅本人条目 |
| `manage_skill` | create/patch/write_file/remove_file/delete 技能(对齐 skill_manage) | 只落本租户 orgs/{org} 或 org 0 降级 users/{uid};改 global 原版走 fork-on-write 继承副本;产线层拒改;子文件限 references/scripts/templates/assets |
| `process` | poll/log/wait/kill 后台任务(配套 run_command background) | 状态文件化在 workspace/.bg/,跨 worker 可见;只解析发起者 workspace |
| `subagent` | list/steer/stop/result 后台子 agent(配套 delegate_subtask background) | 同 workspace 并行上限 3、深度限制 1、子会话历史隔离 |
`run_command` 加 `background`/`timeout` 参数;`delegate_subtask` 加 `background`。
**记忆多租户(memory_store.py)**:每条记忆带 org_id/user_id 归属列;
`visible_to()` 是唯一可见性权威(平台种子 org_id='' 全员只读 + org 归属本机构共享 +
user 归属仅本人 + pipeline/project 域带机构匹配);`memory_key` = hash(content+org+
user+scope+scope_id),同内容跨租户 key 不同、唯一索引永不碰撞;`_evict_partition`
按 org+user 分区淘汰,agent 写入绝不删种子或他租户记忆;写后失效缓存保多 worker
一致。`get()` 是无过滤底层查询(管理用),agent 读取一律走 `get_visible()`。
**ToolDefinition.required 字段(2026-09-10)**:None=旧行为(全参数必填),含可选
参数的工具须显式声明 required 列表,否则 `to_openai_schema()` 把可选参数标成
required、LLM 被迫为每个参数编值。GENERAL_TOOLS 全部带可选参数的工具已补 required。