mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-14 19:37:31 +08:00
autonomy config: add idle_round_budget auto-release policy and fallback max-rounds from runtime_control
This commit is contained in:
@@ -940,6 +940,14 @@ func buildHeartbeatService(cfg *config.Config, msgBus *bus.MessageBus) *heartbea
|
||||
|
||||
func buildAutonomyEngine(cfg *config.Config, msgBus *bus.MessageBus) *autonomy.Engine {
|
||||
a := cfg.Agents.Defaults.Autonomy
|
||||
maxRoundsWithoutUser := a.MaxRoundsWithoutUser
|
||||
if maxRoundsWithoutUser == 0 && cfg.Agents.Defaults.RuntimeControl.AutonomyMaxRoundsWithoutUser > 0 {
|
||||
maxRoundsWithoutUser = cfg.Agents.Defaults.RuntimeControl.AutonomyMaxRoundsWithoutUser
|
||||
}
|
||||
idleRoundBudgetReleaseSec := a.IdleRoundBudgetReleaseSec
|
||||
if idleRoundBudgetReleaseSec == 0 {
|
||||
idleRoundBudgetReleaseSec = 1800
|
||||
}
|
||||
notifyChannel, notifyChatID := inferAutonomyNotifyTarget(cfg)
|
||||
notifyAllowFrom := []string{}
|
||||
switch notifyChannel {
|
||||
@@ -967,10 +975,10 @@ func buildAutonomyEngine(cfg *config.Config, msgBus *bus.MessageBus) *autonomy.E
|
||||
NotifySameReasonCooldownSec: a.NotifySameReasonCooldownSec,
|
||||
QuietHours: a.QuietHours,
|
||||
UserIdleResumeSec: a.UserIdleResumeSec,
|
||||
MaxRoundsWithoutUser: a.MaxRoundsWithoutUser,
|
||||
MaxRoundsWithoutUser: maxRoundsWithoutUser,
|
||||
TaskHistoryRetentionDays: a.TaskHistoryRetentionDays,
|
||||
WaitingResumeDebounceSec: a.WaitingResumeDebounceSec,
|
||||
IdleRoundBudgetReleaseSec: a.IdleRoundBudgetReleaseSec,
|
||||
IdleRoundBudgetReleaseSec: idleRoundBudgetReleaseSec,
|
||||
AllowedTaskKeywords: a.AllowedTaskKeywords,
|
||||
ImportantKeywords: cfg.Agents.Defaults.Texts.AutonomyImportantKeywords,
|
||||
CompletionTemplate: cfg.Agents.Defaults.Texts.AutonomyCompletionTemplate,
|
||||
|
||||
Reference in New Issue
Block a user