feat(awooop): expose mcp evidence details on incidents
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user