feat: add model routing hints and ShouldDelegateTask for simple task delegation#4893
feat: add model routing hints and ShouldDelegateTask for simple task delegation#4893eghrhegpe wants to merge 6 commits into
Conversation
… config 1. ShouldDelegateTask now rejects short inputs containing complex intent terms (refactor, migrate, implement, etc.) — prevents skipping planner for genuinely complex tasks that happen to be under 30 words. 2. Coordinator now has a subAgentModel field. Delegation hint uses this model name instead of a hardcoded deepseek-flash. boot.go wires it from cfg.Agent.SubagentModel when available.
|
主要是双模型强制自动计划太抽象了: Bug 还原 // coordinator.go:172-178 Planner 主动标 [NO_CHANGES](准确) |
|
实际情形: thinking Search 1 files thinking Search 4 files thinking Read 2 files thinking Read 1 files · Search 1 files thinking 证据在 textsink.go:115-120: case event.Phase: // ← 只在实时输出时触发 数据流对比: 内容 实时终端 历史 JSONL deepseek · executing thinking ✗ thinking ✓ thinking ✓ thinking ✓ thinking ✓ thinking 内容 会话历史里有吗? 算是一个小盲区但不算致命。要加的话需要在 session.go 的 provider.Message 里加一个 role: "phase" 类型。改动不大但涉及存储格式变更。 |
2b24dab to
291641d
Compare
2b24dab to
c38d6b2
Compare
Two changes: 1. Coordinator.Run() now checks isNoOpPlan() after plan() returns. If the planner says no changes needed, emit plan text directly and return — skipping the executor entirely. This prevents the executor (Flash) from re-doing the planner's analysis work. 2. formatHandoff now tells the executor to respect the planner's conclusions, not ignore them. isNoOpPlan detects phrases like 'no changes needed', 'already implemented', and the explicit marker '[no_changes]'.
c38d6b2 to
1fdc574
Compare
|
Thanks @eghrhegpe. I consolidated the PE-relevant part of this PR into #4938. What was kept:
What was not kept:
Your contribution is credited in #4938 under Repository Contributor Credits. Closing this PR in favor of the integration PR. |
改动
1. 跳过 executor - planner 说"无需改动"时
Coordinator.Run() 在 plan() 返回后检查 isNoOpPlan():
2. formatHandoff 指令优化
3. ShouldDelegateTask(auto_plan.go)
文件
internal/agent/coordinator.go / control/auto_plan.go / boot/boot.go
Cache-impact: low -- ShouldDelegateTask 和 isNoOpPlan 都是纯启发式函数,不涉及系统提示词变更;Coordinator 的 delegation hint 是 user turn 文本;boot.go 接线不改变工具注册顺序
Cache-guard: go test ./internal/control/ ./internal/agent/
System-prompt-review: @SivanCola -- boot.go 类型断言接线不改前缀结构