feat(tools): add_company_scope 默认绑定由 worker 改为 planner
- WorkerTools 移除 add_company_scope,PlannerTools 新增 - 新库 seed 默认绑定变为 mainagent/planner/auto - 老库加一次性迁移 seedCompanyScopeRebind:加 planner、去 worker
This commit is contained in:
1 parent
4319fe413f
commit
1e7fe8550e
3 files changed
+28
-2
No files matched your search
@@ -448,6 +448,7 @@ func (s *Server) seedOrchestrationTools() {
|
||||
s.refreshBuiltinToolSchemas()
|
||||
s.seedAutoDefaultBindings()
|
||||
s.seedPlannerDefaultBindings()
|
||||
s.seedCompanyScopeRebind()
|
||||
s.seedAutoReportFindingBinding()
|
||||
s.unbindGoalMetDefault()
|
||||
s.reseedGoalsPrompt() // goals 提示词加入「抽操作约束」步 → 旧库追加一版新默认(一次性)
|
||||
@@ -718,6 +719,28 @@ func (s *Server) seedPlannerDefaultBindings() {
|
||||
_ = s.m.pg.SetSetting(flag, "true")
|
||||
}
|
||||
|
||||
// seedCompanyScopeRebind changes add_company_scope's default binding ONCE on
|
||||
// existing DBs (guarded by a settings flag): the tool moves off worker and onto
|
||||
// planner — defining a company's asset scope is a planning/main/auto concern, not
|
||||
// something a worker does mid-exploration. Fresh DBs already get planner via
|
||||
// PlannerTools() and lack worker via WorkerTools(); this only backfills old rows.
|
||||
// One-shot + flag-guarded so a user who later re-binds worker isn't overridden.
|
||||
func (s *Server) seedCompanyScopeRebind() {
|
||||
const flag = "company_scope_rebind_v1" // worker→planner 默认绑定切换
|
||||
if v, _, _ := s.m.pg.GetSetting(flag); v == "true" {
|
||||
return
|
||||
}
|
||||
if err := s.m.pg.AddAgentToToolBinding("planner", []string{"add_company_scope"}); err != nil {
|
||||
log.Printf("[planner] add_company_scope 默认绑定失败: %v", err)
|
||||
return
|
||||
}
|
||||
if err := s.m.pg.RemoveAgentFromTool("worker", "add_company_scope"); err != nil {
|
||||
log.Printf("[worker] add_company_scope 解绑失败: %v", err)
|
||||
return
|
||||
}
|
||||
_ = s.m.pg.SetSetting(flag, "true")
|
||||
}
|
||||
|
||||
// seedAutoDefaultBindings adds "auto" to the task-op + platform tools' bindings
|
||||
// ONCE (guarded by a settings flag), so existing DBs whose tool rows were seeded
|
||||
// before Auto existed still give Auto its default toolset — without re-adding it
|
||||
|
||||
Reference in new issue
Block a user