fix: 收敛受控 CLI 调用与诊断
This commit is contained in:
@@ -2023,10 +2023,10 @@ def root_cause_candidates(http_summary, agentrun, read_model, lag_summary, error
|
||||
status_conflict = terminal_status_conflicts(agentrun.get("terminalStatus"), read_model_turn_status)
|
||||
if status_conflict:
|
||||
candidates.append({
|
||||
"code": "otel_business_trace_terminal_conflict",
|
||||
"label": "OTel terminal conflict",
|
||||
"code": "projection_authority_terminal_conflict",
|
||||
"label": "projection/authority terminal conflict",
|
||||
"confidence": 0.86,
|
||||
"summary": "Scoped AgentRun terminal status conflicts with HWLAB read-model turn status for the requested business trace; prefer the HWLAB read-model status for Workbench RCA and inspect OTel correlation leakage.",
|
||||
"summary": "HWLAB projection conflicts with the scoped AgentRun durable authority; preserve the AgentRun terminal outcome and inspect projection correlation or lag.",
|
||||
"evidence": {
|
||||
"agentrunTerminalStatus": agentrun.get("terminalStatus"),
|
||||
"hwlabReadModelTurnStatus": read_model_turn_status,
|
||||
@@ -2502,16 +2502,16 @@ if http_summary.get("actorForbidden"):
|
||||
read_model_turn_status = read_model.get("turnStatus")
|
||||
agentrun_read_model_status_conflict = terminal_status_conflicts(terminal_status, read_model_turn_status)
|
||||
if agentrun_read_model_status_conflict:
|
||||
facts.append("OTel AgentRun terminal status conflicts with HWLAB read model")
|
||||
if terminal_status in ("failed", "error", "timeout", "blocked", "cancelled") and not agentrun_read_model_status_conflict:
|
||||
facts.append("HWLAB projection conflicts with AgentRun durable authority")
|
||||
if terminal_status in ("failed", "error", "timeout", "blocked", "cancelled"):
|
||||
failure_kind = agentrun.get("failureKind")
|
||||
if failure_kind:
|
||||
facts.append(f"AgentRun terminal failed ({failure_kind})")
|
||||
else:
|
||||
facts.append("AgentRun terminal failed")
|
||||
if terminal_status == "completed" and not agentrun_read_model_status_conflict:
|
||||
if terminal_status == "completed":
|
||||
facts.append("AgentRun completed")
|
||||
if (terminal_status in (None, "") or agentrun_read_model_status_conflict) and read_model_turn_status in ("completed", "failed", "error", "timeout", "blocked", "cancelled", "canceled"):
|
||||
if terminal_status in (None, "") and read_model_turn_status in ("completed", "failed", "error", "timeout", "blocked", "cancelled", "canceled"):
|
||||
facts.append("HWLAB read model terminal " + str(read_model_turn_status))
|
||||
if lag.get("status") in ("confirmed", "suspected"):
|
||||
facts.append("projection/read-model stale")
|
||||
@@ -2552,6 +2552,30 @@ evidence = {
|
||||
"idleWarningSpanCount": len(idle_warning_spans),
|
||||
"idleWarningSpanTail": [tiny_span(item) for item in idle_warning_spans[-3:]],
|
||||
}
|
||||
projection_warning = lag.get("status") in ("confirmed", "suspected") or agentrun_read_model_status_conflict
|
||||
effective_status = terminal_status if terminal_status not in (None, "") else read_model_turn_status
|
||||
typed_outcome = "unknown"
|
||||
if effective_status not in (None, ""):
|
||||
typed_outcome = str(effective_status)
|
||||
if projection_warning:
|
||||
typed_outcome = typed_outcome + "-with-projection-warning"
|
||||
outcome = {
|
||||
"typed": typed_outcome,
|
||||
"effectiveStatus": effective_status,
|
||||
"authority": {
|
||||
"kind": "agentrun-durable-command",
|
||||
"status": terminal_status,
|
||||
"source": agentrun.get("terminalSource"),
|
||||
},
|
||||
"projection": {
|
||||
"kind": "hwlab-read-model",
|
||||
"status": read_model_turn_status,
|
||||
"lag": lag.get("status"),
|
||||
"warning": projection_warning,
|
||||
"blocking": False,
|
||||
},
|
||||
"mutation": False,
|
||||
}
|
||||
payload = {
|
||||
"ok": trace_rc == 0 and len(spans) > 0,
|
||||
"mapping": mapping,
|
||||
@@ -2594,6 +2618,7 @@ payload = {
|
||||
"actorForbidden": http_summary.get("actorForbidden"),
|
||||
},
|
||||
"projectionLag": lag,
|
||||
"outcome": outcome,
|
||||
"summary": summary,
|
||||
"rootCauseCandidates": candidates,
|
||||
"spanNameCounts": flat["spanNameCounts"][:12],
|
||||
|
||||
Reference in New Issue
Block a user