refactor(engine): 全面移除 advising 顾问模式与 handoff 工具——会话默认走模型配置 profile(未配=全量 profile-default.txt)

- engine: resolveProfileName 去掉 advising 强制档;删 enterExecuting/archiveTaskBrief 与 runLoopInner 的阶段守卫、批尾切换逻辑
- tools: definitions.json/executor.js 删 handoff 工具(内置工具 15→14);全局 tools_deny 回退为 ['lab']
- db: sessions.phase 列随概念移除(DROP COLUMN 迁移,旧 SQLite 兜底跳过);createSession/clearSessionMessages 不再读写 phase
- 模板 profile-advising.txt 删除;config.js/config.example.yml 去 advising 组合
- scheduler/wechat 投递前不再有强制 executing;SSE status 事件与会话接口不再携带 phase
- 前端去阶段徽标/phase 事件监听;README 与 docs/ARCHITECTURE.md 同步
This commit is contained in:
2026-10-17 13:00:53 +08:00
parent fe7441c37a
commit fd617b0b8d
19 changed files with 48 additions and 362 deletions
+2 -11
View File
@@ -109,19 +109,10 @@ const DEFAULTS = {
// 模型平台池(无默认值,结构见 config.example.yml)。
platforms: [],
// 全局工具黑名单:profile 未配 tools_deny 时继承它;allow 先、deny 后叠加(deny 赢,与 mcp_servers 同构)。
// 默认屏蔽元工具 lab 与阶段出口 handoff:它们只该出现在显式清空 deny 的 profile 里,
// 不进任何常规请求的 tools 数组(lab → lab 组合;handoff → advising 组合)。
tools_deny: ['lab', 'handoff'],
// 默认屏蔽元工具 lab:它只该出现在显式清空 deny 的 profile 里,不进常规请求的 tools 数组(lab → lab 组合)。
tools_deny: ['lab'],
// 模型 profile(prompt + tools 名单组合):platforms 里的模型用 profile: <名> 引用。
model_profiles: {
// advising:顾问阶段(sessions.phase)专用组合——不由模型配置引用,而是 resolveProfileName 在
// advising 时强制命中:顾问只聊和读、不写(write_file/edit_file/copy_path 不在名单,批内幻觉调用另由引擎挡下;
// list_directory 入选——翻阅历史目录是顾问高频刚需),
// 例外是 profile(画像元信息,不碰任务目录;顾问问答恰是收集称谓/偏好密度最高的时刻)
// 与 recall(日记只读翻阅;用户和顾问聊「上次那个事」恰是回忆查询的高峰场景);
// 唯一出口是 handoff;tools_deny 必须显式清空:不配 = 继承全局 ['lab','handoff'],
// allow 滤完再叠 deny 会把 handoff 自己禁掉(同 lab 组合的教训)。
advising: { tools_allow: ['read_file', 'list_directory', 'fetch', 'handoff', 'profile', 'recall'], tools_deny: [], system_prompt_file: 'profile-advising.txt' },
// lab:统一入口元工具自测组合——tools 收缩到 1 个,其余能力经 lab(help) 现场发现。
// tools_deny 必须显式清空:不配 = 继承全局 ['lab'],deny 后叠加会把 lab 自己禁掉 → 零工具。
lab: { tools_allow: ['lab'], tools_deny: [], system_prompt_file: 'profile-lab.txt' },