@team-agent/installer 0.5.34 → 0.5.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.lock CHANGED
@@ -575,7 +575,7 @@ dependencies = [
575
575
 
576
576
  [[package]]
577
577
  name = "team-agent"
578
- version = "0.5.34"
578
+ version = "0.5.36"
579
579
  dependencies = [
580
580
  "anyhow",
581
581
  "chrono",
package/Cargo.toml CHANGED
@@ -9,7 +9,7 @@ members = ["crates/team-agent", "crates/win-conpty-phase0", "crates/conpty-trans
9
9
 
10
10
  [workspace.package]
11
11
  edition = "2021"
12
- version = "0.5.34"
12
+ version = "0.5.36"
13
13
  license = "AGPL-3.0"
14
14
  rust-version = "1.95"
15
15
 
@@ -52,6 +52,14 @@ pub fn agent_summary_counts(agents: &Value, health: &Value) -> SummaryCounts {
52
52
  .and_then(|v| v.get("status"))
53
53
  .and_then(Value::as_str)
54
54
  .unwrap_or("");
55
+ // 0.5.35 R4 (`.team/artifacts/managed-leader-provider-reentry-locate.md`):
56
+ // canonical `worker_state=UNKNOWN` / `activity.status=uncertain`
57
+ // beats legacy `agent_health.status=WORKING` so the five-line
58
+ // summary stops counting a runtime-honestly-UNKNOWN agent as busy.
59
+ if canonical_worker_state_is_unknown(agent) {
60
+ counts.unknown += 1;
61
+ continue;
62
+ }
55
63
  match classify_agent_bucket(raw, hstatus) {
56
64
  SummaryBucket::Running => counts.running += 1,
57
65
  SummaryBucket::Busy => counts.busy += 1,
@@ -64,6 +72,22 @@ pub fn agent_summary_counts(agents: &Value, health: &Value) -> SummaryCounts {
64
72
  counts
65
73
  }
66
74
 
75
+ /// 0.5.35 R4: return true when the runtime classifier has written a
76
+ /// canonical non-decisive observation onto the agent row. Used by
77
+ /// `agent_summary_counts` and `csv_agent_status` so the "UNKNOWN-first"
78
+ /// signal beats legacy `agent_health.status`.
79
+ fn canonical_worker_state_is_unknown(agent: &Value) -> bool {
80
+ let worker_state_unknown = agent
81
+ .get("worker_state")
82
+ .and_then(Value::as_str)
83
+ .is_some_and(|value| value.eq_ignore_ascii_case("UNKNOWN"));
84
+ let activity_uncertain = agent
85
+ .pointer("/activity/status")
86
+ .and_then(Value::as_str)
87
+ .is_some_and(|value| value.eq_ignore_ascii_case("uncertain"));
88
+ worker_state_unknown || activity_uncertain
89
+ }
90
+
67
91
  fn stale_agent_bucket(agent: &Value) -> Option<SummaryBucket> {
68
92
  if agent.get("stale").and_then(Value::as_bool) != Some(true) {
69
93
  return None;
@@ -224,6 +248,10 @@ fn csv_agent_status(
224
248
  if matches!(raw.as_str(), "running" | "busy" | "working") && !pane_present {
225
249
  return "错误";
226
250
  }
251
+ // 0.5.35 R4: canonical UNKNOWN beats legacy WORKING in human CSV too.
252
+ if canonical_worker_state_is_unknown(agent) {
253
+ return "未知";
254
+ }
227
255
  if raw == "idle" || hstatus == "idle" {
228
256
  return "空闲";
229
257
  }