feat(engine): supervisor scene — opt-in LLM thread stop (Phase 3) #116
Reference in New Issue
Block a user
Delete Branch "feat/110-phase3-supervisor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add supervisor scene — an opt-in LLM-based mechanism that replaces maxRounds as the primary thread stop signal.
Why
maxRounds is a blunt instrument. The supervisor calls a cheap/fast LLM every N rounds to evaluate whether the thread is making progress or stuck, enabling smarter termination.
Changes
engine/supervisor.ts—runSupervisor()+parseSupervisorDecisionText(). CallsresolveModel(config, "supervisor"), sends prompt + recent step summaries to LLM, parses continue/stop.engine/engine.ts— Integrates supervisor check everysupervisorIntervalrounds. Graceful stop with returnCode 0.registry/types.ts—WorkflowConfiggainssupervisorInterval: numberregistry/registry-normalize.ts— Parse supervisorInterval, default 3, 0 disablesengine/types.ts+engine/index.ts+src/index.ts— ExportSupervisorDecisionDesign decisions
models.supervisorconfigured → always returnscontinue(no LLM call)supervisorInterval: 0skips supervisor entirelyRef
Refs #110 (Phase 3)
Review: supervisor scene — opt-in LLM thread stop (Phase 3)
Supervisor 设计合理 — opt-in、interval-based、error=continue(安全默认值)👍
观察
WorkflowConfig形状变了(extract→providers+models+supervisorInterval),现有workflow.yaml会不兼容。PR 描述没提迁移路径Convention ✅
LGTM ✅ 功能本身没问题,建议补个 migration note。
—— 小墨 🖊️