add autonomy control-file switching and block-reason status analytics

This commit is contained in:
DBT
2026-02-24 03:29:38 +00:00
parent c4b17f648e
commit a0585508ee
3 changed files with 99 additions and 2 deletions

View File

@@ -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)