diff --git a/frontend/src/components/usage/CallHistogram.vue b/frontend/src/components/usage/CallHistogram.vue index 8cb0de74c..f72efca59 100644 --- a/frontend/src/components/usage/CallHistogram.vue +++ b/frontend/src/components/usage/CallHistogram.vue @@ -2,14 +2,28 @@
+ {{ unresolved.length }} name{{ unresolved.length === 1 ? '' : 's' }} never completed a call + and {{ unresolved.length === 1 ? 'is' : 'are' }} excluded here — see “Errors & latency”. +
Bars: share of calls that failed, per tool.
+ Table: latency percentiles, read off a fixed histogram — each figure is + the bucket bound the percentile falls in, not a measured duration. +
| Tool | -p50 | -p95 | -Err% | +p50 | +p95 | +Err% | ||
|---|---|---|---|---|---|---|---|---|
| {{ toolLabel(t.server, t.tool) }} | -{{ formatLatency(t.p50_ms) }} | -{{ formatLatency(t.p95_ms) }} | ++ {{ toolLabel(t.server, t.tool) }} + + + · unresolved + + | +{{ formatLatencyBound(t.p50_ms, t.p50_exceeds) }} | +{{ formatLatencyBound(t.p95_ms, t.p95_exceeds) }} | {{ (t.error_rate * 100).toFixed(1) }}% | @@ -49,7 +67,7 @@ import { } from 'chart.js' import type { ChartOptions } from 'chart.js' import type { UsageToolStat } from '@/types' -import { formatNumber, formatLatency, toolLabel } from '@/utils/usageFormat' +import { formatNumber, formatLatencyBound, neverCompleted, toolLabel } from '@/utils/usageFormat' ChartJS.register(BarElement, CategoryScale, LinearScale, Tooltip, Legend) @@ -92,7 +110,14 @@ const chartOptions = computed||
|
- {{ formatTimestamp(activity.timestamp) }}
- {{ formatRelativeTime(activity.timestamp) }}
+ |
+ {{ formatTimestamp(row.activity.timestamp) }}
+
+ {{ formatRelativeTime(row.activity.timestamp) }}
+ · {{ row.runSpan }}
+
|
- {{ getTypeIcon(activity.type) }}
- {{ formatType(activity.type) }}
+ {{ getTypeIcon(row.activity.type) }}
+ {{ formatType(row.activity.type) }}
|
@@ -501,15 +559,15 @@
the word one column to the left.
-->
🧩
-
- {{ activity.tool_name }}
+ |
-
- {{ getSeverityIcon(activity.max_severity) }}
- {{ activity.detection_types?.length || 0 }}
+
+
+ {{ row.activity.detection_types?.length || 0 }}
+
+
+ {{ row.activity.max_severity || 'unknown' }}-severity sensitive data detected
+
-
|
-
- {{ intentOf(activity).label }}
+
+
+ {{ intentOf(row.activity).label }}
+
- {{ intentOf(activity).reason }}
+ {{ intentOf(row.activity).reason }}
+
+
+
+ +…
-
|
- {{ statusPresentation(activity.status).label }} + {{ statusPresentation(row.activity.status).label }} + + + {{ statusPresentation(row.activity.status).label }} | - - {{ formatDuration(activity.duration_ms) }} + + + {{ row.runDuration }} + + + {{ formatDuration(row.activity.duration_ms) }} - |
-
-
- Showing {{ (currentPage - 1) * pageSize + 1 }}-{{ Math.min(currentPage * pageSize, sortedActivities.length) }} of {{ sortedActivities.length }}
+
+
-
-
+ Showing {{ (currentPage - 1) * pageSize + 1 }}-{{ Math.min(currentPage * pageSize, runs.length) }} of {{ runs.length }}
+
+ ({{ sortedActivities.length }} rows, repeats folded)
+
+
+
+
+
Session:
-
{{ selectedActivity.session_id }}
+
+
{{ selectedActivity.session_id }}
+
Source:
@@ -804,6 +945,108 @@
+
+
+ + Scan Verdict ++
+
+
+ Result:
+
+ {{ selectedActivity.status === 'error' ? 'scan failed' : 'scan completed' }}
+
+
+ {{ scanFindingsTotal(selectedActivity.metadata) }}
+ finding{{ scanFindingsTotal(selectedActivity.metadata) === 1 ? '' : 's' }}
+
+
+
+
+
+ {{ selectedActivity.status === 'error' ? 'Found before the failure:' : 'By severity:' }}
+
+
+ {{ entry.severity }} ×{{ entry.count }}
+
+
+ The scan did not complete, so this is not the whole picture.
+
+
+
+ + No findings — the scanners had nothing to report for this server. + ++ This record carries no findings summary, which is not the same as a clean + result — open the Security page for the current verdict. + +
+
+
@@ -989,21 +1232,34 @@ import {
activeFilterChips,
compactSummaryParts,
formatPreflightSummary,
+ formatRunDuration,
+ formatRunSpan,
formatType,
getIntentBadgeClass,
getIntentIcon,
getPreflightVerdictBadgeClass,
getTypeIcon,
+ groupActivityRuns,
intentPresentation,
isChildCall,
isCodeExecutionActivity,
+ isOtherStatus,
isPreflightActivity,
+ isSecurityScanActivity,
preflightIdsCount,
preflightPerTool,
preflightReasonRollup,
+ hasScanFindingsSummary,
+ scanFindingsRollup,
+ scanFindingsTotal,
showParentBadgeInTypeColumn,
+ statusBucketTiles,
statusPresentation,
+ INTENT_LEGEND,
+ OTHER_STATUS,
+ SENSITIVE_LEGEND,
type ActiveFilterChip,
+ type ActivityRun,
type CompactSummaryPart,
type StatusTone,
} from '@/utils/activity'
@@ -1280,6 +1536,26 @@ watch(showFilterPanel, expanded => {
/** "54 calls · 6 errors · 1 blocked" — zeros omitted. */
const summaryParts = computed(() => compactSummaryParts(summary.value))
+/**
+ * The status tiles, as a partition of the Events total beside them (F2, #1046).
+ * The list — including whether the "Other / internal" tile is warranted — is
+ * decided in one pure function so a unit test can assert that the tiles sum to
+ * the denominator without mounting anything.
+ */
+const statusTiles = computed(() => statusBucketTiles(summary.value))
+
+/** Only failures spend colour in the tile row, as in the table's Status column. */
+const statTileValueClass = (tone: StatusTone): string => {
+ switch (tone) {
+ case 'error':
+ return 'text-error'
+ case 'warning':
+ return 'text-warning'
+ default:
+ return 'text-base-content/70'
+ }
+}
+
/** Only error/blocked spend colour; the total and oddities stay quiet. */
const summaryToneClass = (tone: StatusTone): string => {
switch (tone) {
@@ -1381,7 +1657,12 @@ const filteredActivities = computed(() => {
if (filterSession.value) {
result = result.filter(a => matchesSessionFilter(a, filterSession.value, workSessionIndex.value))
}
- if (filterStatus.value) {
+ // "Other / internal" is the residual of the status partition (F2), not a
+ // stored value: it selects every row whose status is outside the tool-call
+ // vocabulary. Applied client-side because there is nothing to ask the API for.
+ if (filterStatus.value === OTHER_STATUS) {
+ result = result.filter(a => isOtherStatus(a.status))
+ } else if (filterStatus.value) {
result = result.filter(a => a.status === filterStatus.value)
}
// Spec 026: Sensitive data filter
@@ -1444,11 +1725,115 @@ const sortedActivities = computed(() => {
return result
})
-const totalPages = computed(() => Math.ceil(sortedActivities.value.length / pageSize.value))
+// --- run folding (F5, #1046) -------------------------------------------------
+//
+// Twelve consecutive identical calls produced twelve rows repeating the same
+// timestamp, the same reason and the same word "Success". Consecutive rows that
+// agree on everything the collapsed line prints fold into one expandable run;
+// status is part of the run identity, so a run can never hide the one call that
+// failed. The grouping itself lives in @/utils/activity and is unit-tested.
+
+const GROUP_REPEATS_STORAGE_KEY = 'mcpproxy.activity.groupRepeats'
+
+const readGroupRepeatsPref = (): boolean => {
+ try {
+ // Default ON: folding is the point. Only an explicit "false" turns it off.
+ return window.localStorage.getItem(GROUP_REPEATS_STORAGE_KEY) !== 'false'
+ } catch {
+ return true
+ }
+}
+
+const groupRepeats = ref(readGroupRepeatsPref())
+
+watch(groupRepeats, on => {
+ try {
+ window.localStorage.setItem(GROUP_REPEATS_STORAGE_KEY, on ? 'true' : 'false')
+ } catch {
+ // A storage failure must never break the table.
+ }
+})
+
+/**
+ * Adjacency only means "repeated" in time order. Sorted by duration or by
+ * server, two neighbouring rows are neighbours by accident, so folding them
+ * would invent a run that never happened.
+ */
+const groupingApplies = computed(() => sortColumn.value === 'timestamp')
+
+/** Run keys the operator has expanded. Cleared whenever the list is refiltered. */
+const expandedRuns = ref(new Set
-
@@ -432,9 +443,14 @@
{{ tokenSavingsData.saved_tokens_percentage >= 99.995 ? '99.99' : tokenSavingsData.saved_tokens_percentage >= 10 ? tokenSavingsData.saved_tokens_percentage.toFixed(1) : tokenSavingsData.saved_tokens_percentage.toFixed(0) }}%
- tokens saved
-
+ smaller tool context per request
+
|