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
-3
View File
@@ -218,9 +218,6 @@ function tick() {
// 顺序不可调换:先存档、后投递。postUserMessage 的 held/空闲分支会同步起 runLoop,
// 存档晚一步,回合就会带着旧上下文开跑。
archiveHistory(db, t.session_id);
// 无人值守的是执行型任务:投递前强制 phase='executing'——新会话可能还停在 advising,
// 顾问 profile 会把半夜的 prompt 当白天聊天「引导澄清并等用户回答」,永远出不了活。
db.prepare("UPDATE sessions SET phase='executing', updated_at=? WHERE id=?").run(now, t.session_id);
const r = deliver(t.session_id, t.prompt);
db.prepare(
"UPDATE scheduled_tasks SET last_run_at=?, last_status='running', last_note=NULL, next_run_at=? WHERE session_id=?"