Repository navigation
feat(agent): emit reconnect-success telemetry - #16629
christian-byrne wants to merge 9 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
christian-byrne
left a comment
There was a problem hiding this comment.
Wiring matches the TEL-11 pattern and the v1 checklist field set. Three takeaways:
replayed_bytesis always 0 in production: the counter is cleared at the ok ack, but the relay sends the catch-updoc_updateafter the ack.attemptis always 1 on the socket-drop path; the TEL-9 counter on the base branch is the natural source after rebase.- Tests cover only the refusal path; the
onReconnectedpath, workflow switch mid-reconnect, and post-ack catch-up are untested.
Full context for agent readers
Reviewed at head 812f755 against merge-base 93aa811 (stacked on #16397). Ran useAgentCrdtFollower.test.ts locally: 24/24 pass. Verified cloud/services/ingest/server/services/websocket/doc_relay.go L579-595 sends doc_subscribed{ok:true, seq} first and then doc_update{seq, update_b64: MissingB64} only when MissingB64 != "". Verified layoutFollowerBridge.ts on this branch drops update.seq <= lastSeq before dispatch (L180), so the catch-up frame never reaches the follower here; merged #16364 on main (44179c5062, catchUpPending/ackSeq) fixes that, so after rebase the catch-up frame will arrive at onUpdate after the ok ack. Negative control: on this branch, ack seq 7 followed by update seq 7 leaves updatesApplied at 0.
Checklist reference: reports/telemetry/v1-checklist.md defines app:agent_reconnect_succeeded as emitted when "FE applies the catch-up delta and restores the subscribed state", with fields attempt, reconnect_duration_ms, replayed_bytes, from_version, to_version. The PR's field set matches exactly; the emission point does not.
Inline comments: one issue: (replayed_bytes/emission point), two suggestion: (attempt source; test coverage), one question: (first-bind refusal counted as reconnect), one nitpick: (to_version fallback).
Since this is my own PR queue, I will push the fix for the emission point and the test coverage to this branch as a follow-up commit and resolve those threads; the attempt source and the first-bind question stay open for the rebase.
|
The PR had drifted back to Full context for agent readersReplayed the three commits from merge base Both hunks were the same seam in Gate evidence at the pushed head, run locally on Node 25:
Grepped for orphans after the resolution: Nothing else changed. Review state is unchanged from the previous round: the attempt-counter thread and the first-bind refusal question are still open and both are owner decisions rather than lifecycle work. |
39ae9c5 to
6de7576
Compare
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1908 passed, 0 failed · 4 flaky📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-10T10:14:05.789Z",
"gitSha": "876e2b880a60446ac436772f62430e53ccb1d934",
"branch": "lane-TEL-10/emit-app-agent-reconnect-succeeded",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2037.8539999999816,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.207000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 520.426,
"heapDeltaBytes": -9113592,
"heapUsedBytes": 61572600,
"domNodes": -279,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 8.963000000000003,
"eventListeners": -150,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2048.5439999999926,
"styleRecalcs": 9,
"styleRecalcDurationMs": 10.334000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 566.8389999999999,
"heapDeltaBytes": -10584396,
"heapUsedBytes": 60253784,
"domNodes": -279,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 11.014000000000003,
"eventListeners": -150,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2066.225999999972,
"styleRecalcs": 80,
"styleRecalcDurationMs": 44.645,
"layouts": 14,
"layoutDurationMs": 5.276,
"taskDurationMs": 1052.474,
"heapDeltaBytes": 5329988,
"heapUsedBytes": 75304864,
"domNodes": -282,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 193.622,
"eventListeners": -184,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1916.3590000000568,
"styleRecalcs": 77,
"styleRecalcDurationMs": 41.949,
"layouts": 14,
"layoutDurationMs": 5.001,
"taskDurationMs": 958.841,
"heapDeltaBytes": 2165452,
"heapUsedBytes": 72262256,
"domNodes": -280,
"jsHeapTotalBytes": 6545408,
"scriptDurationMs": 171.464,
"eventListeners": -180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1716.951999999992,
"styleRecalcs": 31,
"styleRecalcDurationMs": 16.495,
"layouts": 6,
"layoutDurationMs": 1.031,
"taskDurationMs": 364.305,
"heapDeltaBytes": 4934088,
"heapUsedBytes": 75061328,
"domNodes": 76,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 11.164,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1740.9169999999676,
"styleRecalcs": 32,
"styleRecalcDurationMs": 20.756999999999998,
"layouts": 6,
"layoutDurationMs": 1.3339999999999999,
"taskDurationMs": 428.462,
"heapDeltaBytes": 5085428,
"heapUsedBytes": 75880252,
"domNodes": 76,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 14.639999999999997,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 717.8789999999822,
"styleRecalcs": 11,
"styleRecalcDurationMs": 9.373000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 465.34,
"heapDeltaBytes": -7822076,
"heapUsedBytes": 62667548,
"domNodes": 18,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 165.273,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 698.0009999999766,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.292999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 458.909,
"heapDeltaBytes": -7554660,
"heapUsedBytes": 62896332,
"domNodes": 14,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 163.885,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2032.1860000000243,
"styleRecalcs": 3,
"styleRecalcDurationMs": 3.413999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 619.235,
"heapDeltaBytes": 22646500,
"heapUsedBytes": 87945060,
"domNodes": -270,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 39.51299999999999,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2042.5800000000436,
"styleRecalcs": 4,
"styleRecalcDurationMs": 4.512000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 685.8770000000001,
"heapDeltaBytes": 10978920,
"heapUsedBytes": 86746740,
"domNodes": -274,
"jsHeapTotalBytes": -2199552,
"scriptDurationMs": 38.35899999999999,
"eventListeners": -178,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2415.519999999958,
"styleRecalcs": 65,
"styleRecalcDurationMs": 11.055999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1680.828,
"heapDeltaBytes": 21954420,
"heapUsedBytes": 88092028,
"domNodes": -274,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 827.7610000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2580.812000000037,
"styleRecalcs": 64,
"styleRecalcDurationMs": 10.100000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1748.9519999999998,
"heapDeltaBytes": 23059936,
"heapUsedBytes": 88923144,
"domNodes": -275,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 854.3029999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3599.3910000000255,
"styleRecalcs": 60,
"styleRecalcDurationMs": 10.075000000000005,
"layouts": 60,
"layoutDurationMs": 12.206999999999999,
"taskDurationMs": 1742.026,
"heapDeltaBytes": 8493916,
"heapUsedBytes": 75772184,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 784.391,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3680.425000000014,
"styleRecalcs": 60,
"styleRecalcDurationMs": 10.449000000000003,
"layouts": 60,
"layoutDurationMs": 12.698,
"taskDurationMs": 1783.2219999999998,
"heapDeltaBytes": 8196544,
"heapUsedBytes": 76170576,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 795.253,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3153.642999999988,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.788999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1946.3300000000002,
"heapDeltaBytes": 656136,
"heapUsedBytes": 67905828,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 991.753,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3186.663000000067,
"styleRecalcs": 40,
"styleRecalcDurationMs": 5.2079999999999975,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2050.981,
"heapDeltaBytes": 18197736,
"heapUsedBytes": 85317320,
"domNodes": -279,
"jsHeapTotalBytes": 1204224,
"scriptDurationMs": 1010.6339999999998,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2028.1780000000253,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.553,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 573.548,
"heapDeltaBytes": 10864580,
"heapUsedBytes": 87772464,
"domNodes": -275,
"jsHeapTotalBytes": -2461696,
"scriptDurationMs": 33.895999999999994,
"eventListeners": -178,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2006.4519999999675,
"styleRecalcs": 3,
"styleRecalcDurationMs": 3.271999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 565.7769999999999,
"heapDeltaBytes": 22339172,
"heapUsedBytes": 88355696,
"domNodes": -274,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 32.388,
"eventListeners": -148,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 627.3930000000405,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.685999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 419.382,
"heapDeltaBytes": 14855804,
"heapUsedBytes": 87362340,
"domNodes": 20,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 147.75700000000003,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 624.7570000000451,
"styleRecalcs": 46,
"styleRecalcDurationMs": 11.232,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 446.79799999999994,
"heapDeltaBytes": 15190020,
"heapUsedBytes": 88210324,
"domNodes": 18,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 149.177,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2036.6719999999532,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.604,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 507.97700000000003,
"heapDeltaBytes": -9156512,
"heapUsedBytes": 63621532,
"domNodes": -293,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 8.456000000000001,
"eventListeners": -196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2057.327999999984,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.901,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 574.66,
"heapDeltaBytes": 1558628,
"heapUsedBytes": 74501116,
"domNodes": -297,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 11.567,
"eventListeners": -226,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1790.6489999999735,
"styleRecalcs": 77,
"styleRecalcDurationMs": 43.18,
"layouts": 18,
"layoutDurationMs": 6.8870000000000005,
"taskDurationMs": 900.489,
"heapDeltaBytes": -16070468,
"heapUsedBytes": 56847900,
"domNodes": -298,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 120.715,
"eventListeners": -196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1748.0280000000903,
"styleRecalcs": 78,
"styleRecalcDurationMs": 40.32,
"layouts": 18,
"layoutDurationMs": 5.135000000000001,
"taskDurationMs": 905.417,
"heapDeltaBytes": 2773836,
"heapUsedBytes": 75429776,
"domNodes": -295,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 121.915,
"eventListeners": -228,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-transition-enter",
"durationMs": 1417.9490000000214,
"styleRecalcs": 20,
"styleRecalcDurationMs": 32.638,
"layouts": 16,
"layoutDurationMs": 16.108999999999998,
"taskDurationMs": 993.6509999999998,
"heapDeltaBytes": 21854756,
"heapUsedBytes": 105726824,
"domNodes": 13751,
"jsHeapTotalBytes": 11010048,
"scriptDurationMs": 32.925000000000004,
"eventListeners": 2385,
"totalBlockingTimeMs": 146,
"frameDurationMs": 16.669999999999952,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 9309.341000000019,
"styleRecalcs": 247,
"styleRecalcDurationMs": 37.189,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6331.162,
"heapDeltaBytes": -6840660,
"heapUsedBytes": 95284652,
"domNodes": -268,
"jsHeapTotalBytes": -659456,
"scriptDurationMs": 2928.0719999999997,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 9566.667000000052,
"styleRecalcs": 246,
"styleRecalcDurationMs": 38.236,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6426.495,
"heapDeltaBytes": -7482428,
"heapUsedBytes": 94540096,
"domNodes": -272,
"jsHeapTotalBytes": -1445888,
"scriptDurationMs": 2939.1010000000006,
"eventListeners": -130,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 20797.753,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20244.581000000002,
"heapDeltaBytes": -33335916,
"heapUsedBytes": 177150152,
"domNodes": -6548,
"jsHeapTotalBytes": -3624960,
"scriptDurationMs": 408.063,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.773333333333238,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 18067.85500000001,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17484.793,
"heapDeltaBytes": -34565528,
"heapUsedBytes": 175986916,
"domNodes": -6547,
"jsHeapTotalBytes": -4907008,
"scriptDurationMs": 318.98400000000004,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 22219.709000000024,
"styleRecalcs": 178,
"styleRecalcDurationMs": 23.114999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21910.184999999998,
"heapDeltaBytes": -22212752,
"heapUsedBytes": 187473192,
"domNodes": -6548,
"jsHeapTotalBytes": -3682304,
"scriptDurationMs": 1029.5690000000002,
"eventListeners": -7469,
"totalBlockingTimeMs": 58,
"frameDurationMs": 17.77666666666652,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 22748.857000000044,
"styleRecalcs": 174,
"styleRecalcDurationMs": 25.46900000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 22410.764,
"heapDeltaBytes": -37782668,
"heapUsedBytes": 166679700,
"domNodes": -6552,
"jsHeapTotalBytes": -1355776,
"scriptDurationMs": 1031.025,
"eventListeners": -7469,
"totalBlockingTimeMs": 125,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-node-resize-workload",
"durationMs": 6399.201000000005,
"styleRecalcs": 20,
"styleRecalcDurationMs": 82.24799999999999,
"layouts": 20,
"layoutDurationMs": 25.523000000000003,
"taskDurationMs": 6285.344999999999,
"heapDeltaBytes": -24892956,
"heapUsedBytes": 177080224,
"domNodes": -6548,
"jsHeapTotalBytes": 14696448,
"scriptDurationMs": 113.154,
"eventListeners": -7473,
"totalBlockingTimeMs": 402,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 6592.5150000000485,
"styleRecalcs": 20,
"styleRecalcDurationMs": 94.53999999999996,
"layouts": 20,
"layoutDurationMs": 39.188,
"taskDurationMs": 6495.387000000001,
"heapDeltaBytes": -33831380,
"heapUsedBytes": 173532808,
"domNodes": -6547,
"jsHeapTotalBytes": -1351680,
"scriptDurationMs": 128.356,
"eventListeners": -7469,
"totalBlockingTimeMs": 418,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8948.263999999996,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8631.183000000003,
"heapDeltaBytes": 11182408,
"heapUsedBytes": 180017752,
"domNodes": 0,
"jsHeapTotalBytes": -6553600,
"scriptDurationMs": 150.17499999999995,
"eventListeners": -12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8933.137999999984,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8638.481000000002,
"heapDeltaBytes": -229868,
"heapUsedBytes": 174755256,
"domNodes": 0,
"jsHeapTotalBytes": -9699328,
"scriptDurationMs": 173.43399999999997,
"eventListeners": -14,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 485.0289999999404,
"styleRecalcs": 18,
"styleRecalcDurationMs": 23.8,
"layouts": 4,
"layoutDurationMs": 2.1079999999999997,
"taskDurationMs": 123.914,
"heapDeltaBytes": 5013412,
"heapUsedBytes": 73912700,
"domNodes": 145,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 11.550999999999998,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 483.09100000005856,
"styleRecalcs": 12,
"styleRecalcDurationMs": 23.745,
"layouts": 3,
"layoutDurationMs": 1.155,
"taskDurationMs": 114.58700000000002,
"heapDeltaBytes": 4790780,
"heapUsedBytes": 72237444,
"domNodes": 117,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 7.9449999999999985,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
|
|
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## christian-byrne/tel11-reconnect-failed #16629 +/- ##
=======================================================================
Coverage 82.77% 82.77%
=======================================================================
Files 2049 2050 +1
Lines 119522 119608 +86
Branches 32694 32626 -68
=======================================================================
+ Hits 98931 99008 +77
- Misses 20410 20419 +9
Partials 181 181
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 9 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Emits app:agent_reconnect_succeeded exactly once when a reconnect
(socket drop or a server doc_subscribed{ok:false} refusal loop)
resolves with a confirmed subscribe, without replacing the follower
document. Shares the disconnect-signal wiring TEL-11 added for
app:agent_reconnect_failed: onReconnected and scheduleSubscribeRetry
both arm the same reconnect-in-flight bookkeeping (start time,
from_version baseline, replayed-bytes accumulator), cleared by the
same confirmed-subscribe branch that clears the retry timer, so a
first-ever bind (no prior disconnect signal) never reports a
reconnect.
Properties: attempt, reconnect_duration_ms, replayed_bytes,
from_version, to_version -- matches the v1 checklist row exactly
(reports/telemetry/v1-checklist.md).
New tests: reconnect success reports once with normalized metadata,
a second independent reconnect cycle reports again (no stale
bookkeeping), and a first-ever bind does not report success.
The relay sends doc_subscribed{ok:true} first and the catch-up doc_update
(same seq) after it, so emitting at the ack always reported
replayed_bytes: 0. The ok ack now turns the bookkeeping into a pending
report that is flushed by the catch-up frame, by the first live frame
above the ack seq (no catch-up was needed), by the stale probe re-ack,
or by a workflow switch / unmount. attempt, duration and to_version are
snapshotted at the ack so the wait does not stretch the duration.
Tests: rewrite the refusal-path test for the deferred model and add the
socket-drop path, zero-byte live flush, stale-probe flush, and workflow
switch (armed-only vs pending) cases.
Rebasing onto TEL-9 (`app:agent_reconnect_started`, bc37fb3) put two different meanings on one `reconnectAttempt` variable: TEL-9's live socket-reconnect counter and TEL-10's attempt snapshot for the deferred success report. They are now separate (`reconnectReportAttempt` holds the snapshot), and the success report counts BOTH recovery legs — the socket drop's immediate resubscribe plus every refusal-driven retry — instead of only the refusal retries. This test pins that resolution: a socket drop, a server refusal, then a confirmed subscribe reports `attempt: 2`, and the next socket drop still reports `attempt: 1` because the snapshot no longer consumes TEL-9's counter. Tests: pnpm exec vitest run src/workbench/extensions/agent/crdt
6de7576 to
9416ac8
Compare
benjcooley
left a comment
There was a problem hiding this comment.
Review: feat(agent): emit reconnect-success telemetry
Reviewed against the head commit with LayoutFollowerBridge / DocFrameClient read in full, since the composable's correctness here depends entirely on their seq bookkeeping.
| Severity | Count |
|---|---|
| BLOCKER | 2 |
| SHOULD FIX | 6 |
| TRIVIAL | 1 |
The two blockers
1. A first-ever bind that is refused once reports a reconnect success. scheduleSubscribeRetry arms reconnect tracking on any doc_subscribed{ok:false}, and FE-1901's documented reason for that refusal loop is a cold-start race — the subscribe beating the doc-host's mint. So open panel → refused → retry → ok emits app:agent_reconnect_succeeded. The PR description asserts this cannot happen; the first-ever bind test only exercises the un-refused bind, so it proves a guard that isn't in the code.
2. from_version is always 0 on that same refusal path. bridge.lastSequence is lastSeq ?? ackSeq ?? 0, and reconcile() nulls both when the subscribe frame leaves. A refusal is the answer to that subscribe, so armReconnectTracking() reads 0. Only the socket-drop path (which arms before bridge.resubscribe()) captures a real baseline. to_version - from_version is the reason both fields are on the row, and on this path it is always the whole seq.
Both are invisible to the suite because FakeBridge.lastSequence is a static field that resubscribe() never resets — the mock removes the exact bridge behaviour the feature depends on.
Also worth addressing
- An ok ack with no
seq(the field is optional on the wire) emitsto_version: 0against a non-zerofrom_version— a version that moved backwards. - Pre-ack frames are counted as
replayed_byteswholesale, though the bridge explicitly documents that a live frame N+1 can overtake the ack. The post-ack branch guards against exactly this; the pre-ack branch doesn't. onDocReset/onSchemaErrorleave a pending report armed with an ack seq from a dead lineage, and both clear the stale probe that would otherwise flush it.- The reconnect bookkeeping is a three-state machine spread across seven mutable
lets and five mutating helpers, againstdocs/guidance/state-and-effects.md. The lineage-break gap above is a direct consequence of the invariants living in convention rather than in the type.
What's good
The deferred-report design is the right call — emitting at the ack really would have pinned replayed_bytes to 0 — and snapshotting attempt/duration/to_version at the ack so the wait for the catch-up doesn't stretch the duration is a genuinely subtle thing to get right. The flush-on-every-exit-path discipline (retarget watch, unmount, re-arm) is thorough, and the telemetry plumbing across types.ts / registry / PostHog provider matches the existing rows exactly.
Note on the stack
The PR body flags that this branch was deliberately not rebased onto bc37fb3 (TEL-9's reconnectAttempt counter) on the base branch. The attempt computation here already reads that counter, so the merge order isn't cosmetic — whoever lands second needs to re-verify Math.max(1, reconnectAttempt + subscribeRetryAttempt) against whatever TEL-9's counter means at that point.
Seven mutable `let`s and five mutating helpers held one three-phase workflow (idle -> in-flight -> pending-report), with the invariants tying them together enforced only by convention across the helpers. Replace them with a discriminated union and a pure transition in its own module, per docs/guidance/state-and-effects.md, leaving the telemetry emit as the only effect at the edge. Behaviour-preserving: the existing suite passes unchanged. Addresses review feedback: Comfy-Org#16629 (comment)
Arming on any `doc_subscribed{ok:false}` made FE-1901's ordinary cold
start - subscribe, refused, retry, ok - report an
`app:agent_reconnect_succeeded` for a connection that never existed, and
`onReconnected` armed even with no subscribe intent at all. The baseline
was also read off `bridge.lastSequence` at arm time, which `reconcile()`
has already zeroed by then, so every refusal-armed row carried
`from_version: 0`.
Hold the baseline in the composable instead - set by a confirmed ack,
advanced by each applied frame, `null` until the binding is confirmed
once - and arm only when it exists. `null` is both "where were we" and
"was this ever bound", so the two defects share one guard.
The `from_version` assertions could not see this because the fake
bridge's `lastSequence` was a static field no subscribe ever touched;
it now mirrors the real bridge and the assertions fail without the fix.
Addresses review feedback:
Comfy-Org#16629 (comment)
Comfy-Org#16629 (comment)
Comfy-Org#16629 (comment)
Comfy-Org#16629 (comment)
Comfy-Org#16629 (comment)
`DocSubscribed.seq` is optional and the client only sets it for a numeric wire value, so the branch is reachable and emitted e.g. `from_version: 41, to_version: 0` - a version that moved backwards, which reads as corruption rather than as "unknown". Addresses review feedback: Comfy-Org#16629 (comment)
The relay joins the fanout before it acks - the reason `LayoutFollowerBridge.catchUpPending` exists - so a live frame can reach the follower ahead of `doc_subscribed(seq=N)`. Those frames were added to `replayed_bytes` wholesale, the same mistake the post-ack branch avoided. Buffer them until the ack can classify them, then fold in only the ones the ack covers; a buffered frame at the ack seq is the catch-up itself, so the report needs nothing further. Addresses review feedback: Comfy-Org#16629 (comment)
`onDocReset` and `onSchemaError` both clear the stale probe - the only thing that would otherwise flush a pending report - but left the reconnect state alone. After a `doc_reset` the seq space restarts, so the pending ack seq referred to a doc that no longer existed and new-lineage frames were folded into the old lineage's `replayed_bytes`. Neither event is a reconnect success, so both now drop the bookkeeping unreported, and `doc_reset` also drops the baseline with the lineage. Addresses review feedback: Comfy-Org#16629 (comment)
TEL-9's counter only reset on a confirmed subscribe, so a recovery armed and then abandoned by a workflow switch left it elevated and the next workflow's first recovery reported `attempt: 2`. This PR is the second consumer of that counter, so reset it alongside the rest of the binding's bookkeeping. Addresses review feedback: Comfy-Org#16629 (comment)
benjcooley
left a comment
There was a problem hiding this comment.
Scoped follow-up review of the five commits after 9416ac8. The original nine threads are addressed and resolved, including both prior blockers. One new telemetry-correctness blocker remains in the replacement baseline logic.
| Severity | Count |
|---|---|
| BLOCKER | 1 |
| SHOULD FIX | 0 |
| TRIVIAL | 0 |
CI is green at 3216abf; the missing regression is the socket dropping after an ok ack but before its catch-up frame is applied.
| // panel's first-ever bind it merely establishes the baseline below. | ||
| const seq = event.detail?.seq | ||
| onReconnectConfirmed(typeof seq === 'number' ? seq : null) | ||
| confirmedVersion = |
There was a problem hiding this comment.
BLOCKER — confirmedVersion advances at the ack even though the bridge explicitly documents that ackSeq is not an applied baseline: the catch-up at that seq may still be in flight. If the socket drops after doc_subscribed(seq: 43) but before doc_update(seq: 43), the next recovery arms from 43 while the follower is still at 41; isReplay then excludes the required seq-43 catch-up and reports from_version: 43, to_version: 43, replayed_bytes: 0. Keep “this binding was confirmed” separate from the last applied version, and advance the latter only in onUpdate. Add the ack → socket-drop → catch-up regression case.
|
Not closing, but flagging before more of this lands. This PR adds telemetry that measures a disagreement between two implementations of the same behaviour rather than removing the second implementation. The survey found twelve open PRs in this shape. Each metric exists because the agent path and the user path can diverge, and each will read zero by construction once they share a channel: widget writes through What this PR measures: The retirement plan is FE-3586: list every drift event, and for each either the PR that deleted it or the reason it still carries information after that work. Genuine failure reporting goes through Recommendation: same as #16397; also note the base branch is another PR, so this cannot merge independently. Context: FE-3387 (Agent/CRDT alignment programme) and the open-PR survey of 2026-10-22 (thread). Posted for DrJKL. |
Summary
Implements the
app:agent_reconnect_succeededrow from the v1 telemetry checklist (reports/telemetry/v1-checklist.md, mtg-29.2 emitted-vs-required diff, follow-upTEL-10). Stacked on #16397 (app:agent_reconnect_failed, TEL-11), which is itself stacked on #16375.Emits exactly once when a reconnect (socket drop or a server
doc_subscribed{ok:false}refusal loop) resolves with a confirmed subscribe, without replacing the follower document. Reuses the disconnect-signal wiring#16397added fortrackAgentReconnectFailed:onReconnectedandscheduleSubscribeRetryboth arm reconnect-in-flight bookkeeping.The bookkeeping is one discriminated union (
idle/inFlight/pending) with a pure transition insrc/workbench/extensions/agent/crdt/reconnectReport.ts, perdocs/guidance/state-and-effects.md; the telemetry call is the only effect. The report is deferred past the ok ack, because the relay sends the ack first and the catch-updoc_update(same seq) after it, so emitting at the ack would always reportreplayed_bytes: 0.Two guarantees the metric depends on, both enforced by a composable-owned baseline that is
nulluntil a subscribe for the current binding has been confirmed once:from_versionis that baseline, notbridge.lastSequence. The bridge clears its seq bookkeeping insidereconcile()as soon as a subscribe frame leaves, so it reads 0 by the time a refusal comes back.Lineage breaks (
doc_reset,schema_error) and workflow switches drop the bookkeeping rather than reporting against a seq space that no longer exists.Properties match the checklist row exactly:
attempt,reconnect_duration_ms,replayed_bytes,from_version,to_version.attemptis the sum of TEL-9's socket-reconnect counter and the refusal-retry counter, snapshotted at the ack and floored at 1, so a recovery that used both legs reports both.Evidence
Every test added or changed here was verified red-then-green by mutation: reverting each fix in turn fails exactly the test that names it, and restoring
from_version = bridge.lastSequencefails 8 tests (it failed 0 before the fake bridge was made to mirror the realreconcile()behaviour).