mirror of
https://github.com/instructkr/claw-code.git
synced 2026-05-18 21:41:26 +08:00
omx(team): auto-checkpoint worker-3 [4]
This commit is contained in:
@@ -1971,6 +1971,17 @@ impl DoctorReport {
|
|||||||
self.checks.iter().any(|check| check.level.is_failure())
|
self.checks.iter().any(|check| check.level.is_failure())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn status(&self) -> &'static str {
|
||||||
|
let (_, warn_count, fail_count) = self.counts();
|
||||||
|
if fail_count > 0 {
|
||||||
|
"fail"
|
||||||
|
} else if warn_count > 0 {
|
||||||
|
"warn"
|
||||||
|
} else {
|
||||||
|
"ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn render(&self) -> String {
|
fn render(&self) -> String {
|
||||||
let (ok_count, warn_count, fail_count) = self.counts();
|
let (ok_count, warn_count, fail_count) = self.counts();
|
||||||
let mut lines = vec![
|
let mut lines = vec![
|
||||||
@@ -1988,6 +1999,7 @@ impl DoctorReport {
|
|||||||
let (ok_count, warn_count, fail_count) = self.counts();
|
let (ok_count, warn_count, fail_count) = self.counts();
|
||||||
json!({
|
json!({
|
||||||
"kind": "doctor",
|
"kind": "doctor",
|
||||||
|
"status": self.status(),
|
||||||
"message": report,
|
"message": report,
|
||||||
"report": report,
|
"report": report,
|
||||||
"has_failures": self.has_failures(),
|
"has_failures": self.has_failures(),
|
||||||
|
|||||||
@@ -172,6 +172,8 @@ fn inventory_commands_emit_structured_json_when_requested() {
|
|||||||
let mcp = assert_json_command(&root, &["--output-format", "json", "mcp"]);
|
let mcp = assert_json_command(&root, &["--output-format", "json", "mcp"]);
|
||||||
assert_eq!(mcp["kind"], "mcp");
|
assert_eq!(mcp["kind"], "mcp");
|
||||||
assert_eq!(mcp["action"], "list");
|
assert_eq!(mcp["action"], "list");
|
||||||
|
assert_eq!(mcp["status"], "ok");
|
||||||
|
assert!(mcp["config_load_error"].is_null());
|
||||||
|
|
||||||
let skills = assert_json_command(&root, &["--output-format", "json", "skills"]);
|
let skills = assert_json_command(&root, &["--output-format", "json", "skills"]);
|
||||||
assert_eq!(skills["kind"], "skills");
|
assert_eq!(skills["kind"], "skills");
|
||||||
@@ -180,6 +182,10 @@ fn inventory_commands_emit_structured_json_when_requested() {
|
|||||||
let plugins = assert_json_command(&root, &["--output-format", "json", "plugins"]);
|
let plugins = assert_json_command(&root, &["--output-format", "json", "plugins"]);
|
||||||
assert_eq!(plugins["kind"], "plugin");
|
assert_eq!(plugins["kind"], "plugin");
|
||||||
assert_eq!(plugins["action"], "list");
|
assert_eq!(plugins["action"], "list");
|
||||||
|
assert_eq!(plugins["status"], "ok");
|
||||||
|
assert!(plugins["config_load_error"].is_null());
|
||||||
|
assert_eq!(plugins["status"], "ok");
|
||||||
|
assert!(plugins["config_load_error"].is_null());
|
||||||
assert!(
|
assert!(
|
||||||
plugins["reload_runtime"].is_boolean(),
|
plugins["reload_runtime"].is_boolean(),
|
||||||
"plugins reload_runtime should be a boolean"
|
"plugins reload_runtime should be a boolean"
|
||||||
@@ -395,6 +401,7 @@ fn doctor_and_resume_status_emit_json_when_requested() {
|
|||||||
|
|
||||||
let doctor = assert_json_command(&root, &["--output-format", "json", "doctor"]);
|
let doctor = assert_json_command(&root, &["--output-format", "json", "doctor"]);
|
||||||
assert_eq!(doctor["kind"], "doctor");
|
assert_eq!(doctor["kind"], "doctor");
|
||||||
|
assert_eq!(doctor["status"], "ok");
|
||||||
assert!(doctor["message"].is_string());
|
assert!(doctor["message"].is_string());
|
||||||
let summary = doctor["summary"].as_object().expect("doctor summary");
|
let summary = doctor["summary"].as_object().expect("doctor summary");
|
||||||
assert!(summary["ok"].as_u64().is_some());
|
assert!(summary["ok"].as_u64().is_some());
|
||||||
|
|||||||
Reference in New Issue
Block a user