apply go-centric architecture optimizations and document them in readme

This commit is contained in:
DBT
2026-02-24 09:25:12 +00:00
parent 3dd918d429
commit 4105eeb0db
7 changed files with 209 additions and 12 deletions

View File

@@ -24,6 +24,7 @@ import (
"clawgo/pkg/heartbeat"
"clawgo/pkg/logger"
"clawgo/pkg/providers"
"clawgo/pkg/runtimecfg"
"clawgo/pkg/sentinel"
)
@@ -62,6 +63,7 @@ func gatewayCmd() {
fmt.Printf("Error loading config: %v\n", err)
os.Exit(1)
}
runtimecfg.Set(cfg)
if strings.EqualFold(strings.TrimSpace(os.Getenv(envRootGranted)), "1") || strings.EqualFold(strings.TrimSpace(os.Getenv(envRootGranted)), "true") {
applyMaximumPermissionPolicy(cfg)
}
@@ -238,6 +240,7 @@ func gatewayCmd() {
sentinelService.Start()
}
cfg = newCfg
runtimecfg.Set(cfg)
if len(templateChanges) > 0 {
fmt.Printf("↻ Dialog template changes: %s\n", strings.Join(templateChanges, ", "))
}
@@ -260,6 +263,7 @@ func gatewayCmd() {
channelManager = newChannelManager
agentLoop = newAgentLoop
cfg = newCfg
runtimecfg.Set(cfg)
sentinelService.Stop()
sentinelService = sentinel.NewService(
getConfigPath(),