mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-19 22:33:05 +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 {
|
func buildAutonomyEngine(cfg *config.Config, msgBus *bus.MessageBus) *autonomy.Engine {
|
||||||
a := cfg.Agents.Defaults.Autonomy
|
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)
|
notifyChannel, notifyChatID := inferAutonomyNotifyTarget(cfg)
|
||||||
notifyAllowFrom := []string{}
|
notifyAllowFrom := []string{}
|
||||||
switch notifyChannel {
|
switch notifyChannel {
|
||||||
@@ -967,10 +975,10 @@ func buildAutonomyEngine(cfg *config.Config, msgBus *bus.MessageBus) *autonomy.E
|
|||||||
NotifySameReasonCooldownSec: a.NotifySameReasonCooldownSec,
|
NotifySameReasonCooldownSec: a.NotifySameReasonCooldownSec,
|
||||||
QuietHours: a.QuietHours,
|
QuietHours: a.QuietHours,
|
||||||
UserIdleResumeSec: a.UserIdleResumeSec,
|
UserIdleResumeSec: a.UserIdleResumeSec,
|
||||||
MaxRoundsWithoutUser: a.MaxRoundsWithoutUser,
|
MaxRoundsWithoutUser: maxRoundsWithoutUser,
|
||||||
TaskHistoryRetentionDays: a.TaskHistoryRetentionDays,
|
TaskHistoryRetentionDays: a.TaskHistoryRetentionDays,
|
||||||
WaitingResumeDebounceSec: a.WaitingResumeDebounceSec,
|
WaitingResumeDebounceSec: a.WaitingResumeDebounceSec,
|
||||||
IdleRoundBudgetReleaseSec: a.IdleRoundBudgetReleaseSec,
|
IdleRoundBudgetReleaseSec: idleRoundBudgetReleaseSec,
|
||||||
AllowedTaskKeywords: a.AllowedTaskKeywords,
|
AllowedTaskKeywords: a.AllowedTaskKeywords,
|
||||||
ImportantKeywords: cfg.Agents.Defaults.Texts.AutonomyImportantKeywords,
|
ImportantKeywords: cfg.Agents.Defaults.Texts.AutonomyImportantKeywords,
|
||||||
CompletionTemplate: cfg.Agents.Defaults.Texts.AutonomyCompletionTemplate,
|
CompletionTemplate: cfg.Agents.Defaults.Texts.AutonomyCompletionTemplate,
|
||||||
|
|||||||
Reference in New Issue
Block a user