diff --git a/cmd/clawgo/cli_common.go b/cmd/clawgo/cli_common.go index 7147048..db5484e 100644 --- a/cmd/clawgo/cli_common.go +++ b/cmd/clawgo/cli_common.go @@ -108,6 +108,7 @@ func printHelp() { fmt.Println(" clawgo gateway # register service") fmt.Println(" clawgo gateway start|stop|restart|status") fmt.Println(" clawgo gateway run # run foreground") + fmt.Println(" clawgo gateway autonomy on|off|status") fmt.Println() fmt.Println("Uninstall:") fmt.Println(" clawgo uninstall # remove gateway service") diff --git a/cmd/clawgo/cmd_status.go b/cmd/clawgo/cmd_status.go index cbd0413..85b501e 100644 --- a/cmd/clawgo/cmd_status.go +++ b/cmd/clawgo/cmd_status.go @@ -177,12 +177,20 @@ func summarizeAutonomyActions(statsJSON []byte) string { return "" } keys := []string{"autonomy:dispatch", "autonomy:waiting", "autonomy:resume", "autonomy:blocked", "autonomy:complete"} - parts := make([]string, 0, len(keys)) + parts := make([]string, 0, len(keys)+1) + total := 0 for _, k := range keys { if v, ok := payload.Counts[k]; ok { parts = append(parts, fmt.Sprintf("%s=%d", strings.TrimPrefix(k, "autonomy:"), v)) + total += v } } + if total > 0 { + d := payload.Counts["autonomy:dispatch"] + w := payload.Counts["autonomy:waiting"] + b := payload.Counts["autonomy:blocked"] + parts = append(parts, fmt.Sprintf("ratios(dispatch/waiting/blocked)=%.2f/%.2f/%.2f", float64(d)/float64(total), float64(w)/float64(total), float64(b)/float64(total))) + } return strings.Join(parts, " ") }