mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-06 11:49:45 +08:00
add autonomy control-file switching and block-reason status analytics
This commit is contained in:
@@ -138,6 +138,7 @@ func statusCmd() {
|
||||
if nextRetry != "" {
|
||||
fmt.Printf("Autonomy Next Retry: %s\n", nextRetry)
|
||||
}
|
||||
fmt.Printf("Autonomy Control: %s\n", autonomyControlState(workspace))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,6 +165,25 @@ func printTemplateField(name, current, def string) {
|
||||
fmt.Printf(" %s: %s\n", name, state)
|
||||
}
|
||||
|
||||
func autonomyControlState(workspace string) string {
|
||||
memDir := filepath.Join(workspace, "memory")
|
||||
pausePath := filepath.Join(memDir, "autonomy.pause")
|
||||
if _, err := os.Stat(pausePath); err == nil {
|
||||
return "paused (autonomy.pause)"
|
||||
}
|
||||
ctrlPath := filepath.Join(memDir, "autonomy.control.json")
|
||||
if data, err := os.ReadFile(ctrlPath); err == nil {
|
||||
var c struct{ Enabled bool `json:"enabled"` }
|
||||
if json.Unmarshal(data, &c) == nil {
|
||||
if c.Enabled {
|
||||
return "enabled"
|
||||
}
|
||||
return "disabled (control file)"
|
||||
}
|
||||
}
|
||||
return "default"
|
||||
}
|
||||
|
||||
func collectSessionKindCounts(sessionsDir string) (map[string]int, error) {
|
||||
indexPath := filepath.Join(sessionsDir, "sessions.json")
|
||||
data, err := os.ReadFile(indexPath)
|
||||
|
||||
Reference in New Issue
Block a user