feat(awooop): expose mcp evidence details on incidents
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
CD Pipeline / tests (push) Successful in 3m31s
CD Pipeline / build-and-deploy (push) Successful in 4m12s
CD Pipeline / post-deploy-checks (push) Successful in 2m1s

This commit is contained in:
Your Name
2026-05-20 15:01:52 +08:00
parent f85a876868
commit c426b1ce7b
6 changed files with 151 additions and 0 deletions

View File

@@ -35,6 +35,33 @@ export interface AwoooPStatusChain {
incident?: boolean | null;
auto_repair?: boolean | null;
};
mcp?: {
gateway?: {
total?: number | null;
success?: number | null;
failed?: number | null;
blocked?: number | null;
first_class_total?: number | null;
legacy_bridge_total?: number | null;
policy_enforced_total?: number | null;
stage?: string | null;
stage_status?: string | null;
};
legacy?: {
total?: number | null;
success?: number | null;
failed?: number | null;
};
top_tools?: Array<{
source?: string | null;
tool_name?: string | null;
total?: number | null;
success?: number | null;
failed?: number | null;
blocked?: number | null;
last_error?: string | null;
}>;
};
}
function toneClass(chain?: AwoooPStatusChain | null) {

View File

@@ -335,6 +335,22 @@ export function IncidentCard({ incident, decision, statusChain, onApprovalChange
active: (statusChain?.evidence?.auto_repair_records ?? 0) > 0,
},
] : []
const mcpTopTools = (statusChain?.mcp?.top_tools ?? []).slice(0, 3).map(tool => {
const toolName = chainValue(tool.tool_name)
return `${toolName} ${tool.success ?? 0}/${tool.failed ?? 0}/${tool.blocked ?? 0}`
}).join(', ')
const mcpGateway = statusChain?.mcp?.gateway
const mcpLegacy = statusChain?.mcp?.legacy
const statusChainMcpDetail = hasTruthChain
? t('flowMcpDetail', {
success: mcpGateway?.success ?? 0,
failed: mcpGateway?.failed ?? 0,
blocked: mcpGateway?.blocked ?? 0,
firstClass: mcpGateway?.first_class_total ?? 0,
legacy: mcpLegacy?.total ?? 0,
tools: mcpTopTools || '--',
})
: null
const serviceName = incident.affected_services?.[0] ?? '--'
const duration = formatDuration(incident.created_at)
@@ -606,6 +622,10 @@ export function IncidentCard({ incident, decision, statusChain, onApprovalChange
</strong>
))}
</span>
<span style={{ color: '#b0ad9f' }}>/</span>
<span data-testid="incident-mcp-evidence" style={{ color: '#555550' }}>
{statusChainMcpDetail}
</span>
</>
)}
</div>