Repository navigation
Commit 3bfc1b1
fix(activity): histogram≙log parity, status-aware grouping, code-exec sub-call transparency (#1016)
* fix(activity): histogram≙log parity, status-aware tray grouping, code-exec sub-call transparency
- Histogram now counts internal tool calls (retrieve_tools/describe_tool/code_execution/…)
and blocked policy decisions, matching the tray glance population; call_tool_* variant
echoes excluded everywhere (list + histogram) since every one pairs with a canonical record
- Usage aggregate replays activity records newer than the persisted snapshot on startup
(no more permanent drift after unclean shutdown); internal calls now reach the live aggregate
- /activity/summary computes over the full period, not the newest 50 records
- code_execution: ExecutionID pass-by-value bug fixed; every sandbox sub-call now emits a
first-class tool_call activity record with fresh request_id + parent_id linkage
- parent_id: new ActivityRecord field, list/export filter, swagger, SSE passthrough
- Web UI: parent/child badges, View sub-calls / View parent navigation in Activity drawer
- CLI: activity list/export --parent-id, child markers in table+watch, show hints, docs
- Tray: run grouping key now includes status class — ok and errored calls never merge;
spec 090 FR-002/FR-004 amended; parent_id decoded
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(tray): mirror the widened usage-timeline rule in the live SSE header count
countsTowardUsageTimeline still counted only tool_call records, so internal
calls (code_execution, retrieve_tools) and blocked policy decisions moved the
bars at the next poll but not the header — the header lagged the rows by up to
30s. Now mirrors UsageAggregate.Apply case-for-case (internal non-call_tool_*
count, rejected tool_call sheds and call_tool_* echoes stay out, blocked and
rejected policy decisions count).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(activity): address cross-review findings — snapshot versioning, glance-set parity, sandbox shed/refusal records
Opencode cross-review of #1016 surfaced four genuine defects:
- Snapshots built under the old admission rule (no internal calls) were
carried forward after upgrade; aggregates now stamp an AdmissionVersion and
a mismatched snapshot is rebuilt from a full activity scan (decode clears
the constructor default so legacy snapshots can't masquerade as current;
clone() now carries the stamp).
- Successful management built-ins (upstream_servers, quarantine_security, …)
entered the timeline but are not glance rows; admission now counts internal
successes only for retrieve_tools/describe_tool/code_execution, failures
always. Swift live-count mirror updated in lockstep.
- A concurrency shed inside a sandbox sub-call was double-recorded: the
limiter's origin-independent observer already emits the canonical rejected
record, so emitSubCallActivity now skips limiter sheds.
- A sandbox policy refusal was recorded as an executed error call; it is now
status=blocked, and blocked tool_calls route like blocked policy decisions
(Blocked counter + failed timeline bar, no Calls/latency/bytes).
Known accepted trade-offs (documented in code): the catch-up replay's strict
timestamp bound can miss a record whose Apply lagged its Save across a crash
(the alternative is permanent double-counting), and startup rejected-shed
recording is synchronous by design.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(activity): round-2 review — rule-1 parity for management built-ins, narrow the sandbox shed skip
- Management built-ins (upstream_servers, quarantine_security) are hidden
from the glance whatever their status (GlanceSelection rule 1), so their
failures must not bar either; Go admission and the Swift live-count mirror
now exclude them entirely (non-management internal failures still count).
- emitSubCallActivity skipped every limiter error, but only queue_full/
queue_timeout sheds get the canonical rejected record from the admission
observer — a server_unavailable refusal lost its only activity record.
The skip (shedHasCanonicalRecord, unit-tested) is now reason-scoped.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(activity): bump usageAdmissionVersion for the rule-1 admission change
Round-3 review: the round-2 admission narrowing (management built-ins out)
changed which records count, so snapshots stamped 2 must rebuild too.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(macos): parent↔child navigation + formatted code in the Activity window
User feedback on #1016: the native Activity window had no way to walk from a
code_execution to its sub-calls or back, and the code argument rendered as an
escaped one-line JSON string.
- Detail panel: 'View sub-calls' on code_execution parents filters the list
by parent_id (with a dismissable chip); sub-call records show 'View parent
call', which restores the list and selects the parent (fetched by
request_id and pinned if it scrolled past the page).
- List rows: sub-calls carry an arrow marker in the Details column.
- Detail panel: the code argument renders as a Code section (language badge,
monospace); one-line agent scripts are broken at statement boundaries —
never inside string literals or parens (formatScriptForDisplay, unit-tested).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(macos): round-5 review — load-ticket guard + drop selection on sub-call filter
- loadActivities now publishes only the newest in-flight fetch (monotonic
ticket), so a slow unfiltered load can't overwrite the sub-call view.
- Entering the sub-call view drops the parent's selection so clearing the
chip doesn't silently reopen its detail panel.
- formatScriptForDisplay documents its display-only limits (regex literals,
nested template substitutions); Copy always yields the verbatim script.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(activity): sync docs with parent_id + call_tool_* dedup behavior
Docs audit findings (PR #1016): drop the stale 'failed call_tool_* are always
shown' claims (all call_tool_* records are hidden by default now — every
dispatch has a paired canonical record), add the parent_id query param to the
REST + feature docs, document code_execution sub-call records and their
parent/child navigation, and note sub-call activity logging in the
code-execution security model.
Spec audit: no normative amendments needed — spec 096 FR-010 (sub-calls
recorded in activity logging) is fulfilled by this PR, spec 090 was amended
in-branch, spec 093's rejected-shed exclusion is preserved.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(specs): amend 024 duplicate-filtering note + 069 usage-timeline contract
Spec audit for PR #1016: two normative statements were made stale by this PR.
Spec 024's note claimed failed call_tool_* records are the sole witness of a
failed dispatch (they are paired now, and hidden by default); spec 069's usage
contract said the timeline excludes blocked attempts (it now mirrors the
glance population). Both amended with superseded notes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 52146a4 commit 3bfc1b1
54 files changed
Lines changed: 2824 additions & 237 deletions
File tree
- cmd/mcpproxy
- docs
- api
- cli
- code_execution
- features
- frontend
- src
- components
- services
- types
- utils
- views
- tests/unit
- internal
- contracts
- httpapi
- runtime
- server
- storage
- native/macos/MCPProxy
- MCPProxyTests
- MCPProxy
- API
- Menu/Glance
- State
- Views
- oas
- specs
- 024-expand-activity-log
- 069-observability-usage-graphs/contracts
- 090-tray-glance-v2
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
231 | 238 | | |
232 | 239 | | |
233 | 240 | | |
| |||
856 | 863 | | |
857 | 864 | | |
858 | 865 | | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
859 | 869 | | |
860 | 870 | | |
861 | 871 | | |
| |||
932 | 942 | | |
933 | 943 | | |
934 | 944 | | |
935 | | - | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
936 | 949 | | |
937 | 950 | | |
938 | 951 | | |
| |||
962 | 975 | | |
963 | 976 | | |
964 | 977 | | |
| 978 | + | |
965 | 979 | | |
966 | 980 | | |
967 | 981 | | |
| |||
995 | 1009 | | |
996 | 1010 | | |
997 | 1011 | | |
| 1012 | + | |
998 | 1013 | | |
999 | 1014 | | |
1000 | 1015 | | |
| |||
1045 | 1060 | | |
1046 | 1061 | | |
1047 | 1062 | | |
| 1063 | + | |
1048 | 1064 | | |
1049 | 1065 | | |
1050 | 1066 | | |
| |||
1147 | 1163 | | |
1148 | 1164 | | |
1149 | 1165 | | |
1150 | | - | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1151 | 1169 | | |
1152 | 1170 | | |
1153 | 1171 | | |
| |||
1433 | 1451 | | |
1434 | 1452 | | |
1435 | 1453 | | |
| 1454 | + | |
| 1455 | + | |
1436 | 1456 | | |
1437 | 1457 | | |
1438 | 1458 | | |
| |||
1465 | 1485 | | |
1466 | 1486 | | |
1467 | 1487 | | |
| 1488 | + | |
1468 | 1489 | | |
1469 | 1490 | | |
1470 | 1491 | | |
| |||
1547 | 1568 | | |
1548 | 1569 | | |
1549 | 1570 | | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
1550 | 1606 | | |
1551 | 1607 | | |
1552 | 1608 | | |
| |||
1621 | 1677 | | |
1622 | 1678 | | |
1623 | 1679 | | |
1624 | | - | |
| 1680 | + | |
| 1681 | + | |
1625 | 1682 | | |
1626 | 1683 | | |
1627 | 1684 | | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
1628 | 1696 | | |
1629 | 1697 | | |
1630 | 1698 | | |
| |||
1779 | 1847 | | |
1780 | 1848 | | |
1781 | 1849 | | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
1782 | 1887 | | |
1783 | 1888 | | |
1784 | 1889 | | |
| |||
1812 | 1917 | | |
1813 | 1918 | | |
1814 | 1919 | | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | | - | |
1819 | | - | |
1820 | | - | |
1821 | | - | |
1822 | | - | |
1823 | | - | |
1824 | | - | |
1825 | | - | |
1826 | | - | |
1827 | | - | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
1838 | | - | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
| 1920 | + | |
1843 | 1921 | | |
1844 | 1922 | | |
1845 | 1923 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
0 commit comments