Repository navigation
fix(agent): redact sensitive dev panel event details - #16659
christian-byrne wants to merge 3 commits into
Conversation
|
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
Comment |
🎭 Playwright: ❌ 1904 passed, 52 failed · 4 flaky❌ Failed Tests📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-02T15:12:20.583Z",
"gitSha": "eb7ff050a52f66b5b0b19b7d7ca7dc653dcf5834",
"branch": "christian/fec-redact-1",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2017.5330000000145,
"styleRecalcs": 8,
"styleRecalcDurationMs": 4.941999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 378.055,
"heapDeltaBytes": 2638804,
"heapUsedBytes": 99451548,
"domNodes": 16,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 7.176999999999996,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2020.2110000000175,
"styleRecalcs": 8,
"styleRecalcDurationMs": 5.383000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 395.28,
"heapDeltaBytes": 3385824,
"heapUsedBytes": 100249040,
"domNodes": 16,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 12.401,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2036.6260000000125,
"styleRecalcs": 81,
"styleRecalcDurationMs": 33.141999999999996,
"layouts": 14,
"layoutDurationMs": 4.345,
"taskDurationMs": 1045.006,
"heapDeltaBytes": -7120332,
"heapUsedBytes": 89820116,
"domNodes": 67,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 120.36699999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1918.7930000000506,
"styleRecalcs": 76,
"styleRecalcDurationMs": 32.80200000000001,
"layouts": 14,
"layoutDurationMs": 4.827,
"taskDurationMs": 942.2579999999999,
"heapDeltaBytes": -7163904,
"heapUsedBytes": 89773656,
"domNodes": 59,
"jsHeapTotalBytes": 8126464,
"scriptDurationMs": 114.081,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1734.7049999999626,
"styleRecalcs": 31,
"styleRecalcDurationMs": 13.827999999999998,
"layouts": 6,
"layoutDurationMs": 1.2180000000000002,
"taskDurationMs": 324.39099999999996,
"heapDeltaBytes": 5507668,
"heapUsedBytes": 102779080,
"domNodes": 76,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 10.589,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1707.096999999976,
"styleRecalcs": 30,
"styleRecalcDurationMs": 14.555,
"layouts": 6,
"layoutDurationMs": 1.0910000000000002,
"taskDurationMs": 327.942,
"heapDeltaBytes": 5896620,
"heapUsedBytes": 101870512,
"domNodes": 76,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 10.876,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 783.4479999999644,
"styleRecalcs": 13,
"styleRecalcDurationMs": 5.820999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 549.55,
"heapDeltaBytes": 6866896,
"heapUsedBytes": 103937708,
"domNodes": 18,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 114.003,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 834.5010000000457,
"styleRecalcs": 13,
"styleRecalcDurationMs": 6.051999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 565.0419999999999,
"heapDeltaBytes": 7510992,
"heapUsedBytes": 103837228,
"domNodes": 18,
"jsHeapTotalBytes": 7340032,
"scriptDurationMs": 116.223,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2003.4599999999614,
"styleRecalcs": 6,
"styleRecalcDurationMs": 4.268000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 458.76699999999994,
"heapDeltaBytes": 16912372,
"heapUsedBytes": 121546416,
"domNodes": 12,
"jsHeapTotalBytes": 3670016,
"scriptDurationMs": 33.96399999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 1993.0719999999837,
"styleRecalcs": 6,
"styleRecalcDurationMs": 3.481,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 453.8299999999999,
"heapDeltaBytes": 16980936,
"heapUsedBytes": 120287732,
"domNodes": 12,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 32.16400000000001,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 3090.944000000036,
"styleRecalcs": 67,
"styleRecalcDurationMs": 11.436,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1942.494,
"heapDeltaBytes": -6187260,
"heapUsedBytes": 98522876,
"domNodes": 10,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 657.614,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 3110.43200000006,
"styleRecalcs": 67,
"styleRecalcDurationMs": 11.846,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2001.8180000000002,
"heapDeltaBytes": -6275344,
"heapUsedBytes": 98752276,
"domNodes": 10,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 657.1819999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 4001.1140000000296,
"styleRecalcs": 68,
"styleRecalcDurationMs": 13.867999999999999,
"layouts": 60,
"layoutDurationMs": 13.331,
"taskDurationMs": 2053.683,
"heapDeltaBytes": 4360468,
"heapUsedBytes": 113712688,
"domNodes": 30,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 662.566,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "large-graph-zoom",
"durationMs": 4088.3010000000013,
"styleRecalcs": 68,
"styleRecalcDurationMs": 14.225999999999999,
"layouts": 60,
"layoutDurationMs": 14.105999999999998,
"taskDurationMs": 2059.806,
"heapDeltaBytes": 10814172,
"heapUsedBytes": 120710692,
"domNodes": 28,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 657.952,
"eventListeners": 12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3906.125999999972,
"styleRecalcs": 43,
"styleRecalcDurationMs": 6.565000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2767.2929999999997,
"heapDeltaBytes": -13062276,
"heapUsedBytes": 98877492,
"domNodes": 6,
"jsHeapTotalBytes": 6291456,
"scriptDurationMs": 733.715,
"eventListeners": 190,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 4178.947999999991,
"styleRecalcs": 43,
"styleRecalcDurationMs": 7.129,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2900.208,
"heapDeltaBytes": -13062696,
"heapUsedBytes": 98982516,
"domNodes": 6,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 745.146,
"eventListeners": 192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 1999.9409999999216,
"styleRecalcs": 5,
"styleRecalcDurationMs": 3.4240000000000017,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 439.017,
"heapDeltaBytes": -9736080,
"heapUsedBytes": 96284632,
"domNodes": 10,
"jsHeapTotalBytes": 3670016,
"scriptDurationMs": 31.013000000000005,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 1997.6880000000392,
"styleRecalcs": 6,
"styleRecalcDurationMs": 3.8160000000000016,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 443.901,
"heapDeltaBytes": -9952152,
"heapUsedBytes": 96098180,
"domNodes": 12,
"jsHeapTotalBytes": 3670016,
"scriptDurationMs": 31.694,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 595.8609999998998,
"styleRecalcs": 47,
"styleRecalcDurationMs": 7.427,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 410.58700000000005,
"heapDeltaBytes": -6177084,
"heapUsedBytes": 91594512,
"domNodes": 20,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 104.33000000000001,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 609.6090000000913,
"styleRecalcs": 47,
"styleRecalcDurationMs": 8.012000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 431.233,
"heapDeltaBytes": -5790492,
"heapUsedBytes": 91923960,
"domNodes": 20,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 108.47899999999998,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2007.64300000003,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.311,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 392.64200000000005,
"heapDeltaBytes": 2991772,
"heapUsedBytes": 100376744,
"domNodes": 22,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 7.556,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 1999.1660000000593,
"styleRecalcs": 9,
"styleRecalcDurationMs": 5.811,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 386.683,
"heapDeltaBytes": 3179508,
"heapUsedBytes": 100666656,
"domNodes": 18,
"jsHeapTotalBytes": 6553600,
"scriptDurationMs": 7.381,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1744.2510000000198,
"styleRecalcs": 79,
"styleRecalcDurationMs": 33.69800000000001,
"layouts": 18,
"layoutDurationMs": 5.523,
"taskDurationMs": 885.341,
"heapDeltaBytes": 6876756,
"heapUsedBytes": 104257128,
"domNodes": 67,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 81.327,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1751.1469999999463,
"styleRecalcs": 78,
"styleRecalcDurationMs": 31.592999999999996,
"layouts": 18,
"layoutDurationMs": 5.3020000000000005,
"taskDurationMs": 873.5889999999999,
"heapDeltaBytes": 6746820,
"heapUsedBytes": 104664568,
"domNodes": 69,
"jsHeapTotalBytes": 7340032,
"scriptDurationMs": 80.282,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 982.8249999999343,
"styleRecalcs": 20,
"styleRecalcDurationMs": 25.742000000000008,
"layouts": 16,
"layoutDurationMs": 10.582,
"taskDurationMs": 787.6530000000001,
"heapDeltaBytes": 20191656,
"heapUsedBytes": 128928644,
"domNodes": 13671,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 26.147999999999996,
"eventListeners": 2381,
"totalBlockingTimeMs": 129,
"frameDurationMs": 16.659999999999975,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 12151.775999999927,
"styleRecalcs": 248,
"styleRecalcDurationMs": 37.244,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7009.837,
"heapDeltaBytes": -13214708,
"heapUsedBytes": 91228308,
"domNodes": -280,
"jsHeapTotalBytes": -3518464,
"scriptDurationMs": 2208.478,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 12253.841999999964,
"styleRecalcs": 247,
"styleRecalcDurationMs": 41.42700000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7736.244000000001,
"heapDeltaBytes": -15517980,
"heapUsedBytes": 89262936,
"domNodes": -281,
"jsHeapTotalBytes": -2732032,
"scriptDurationMs": 2497.952,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 14538.216000000033,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13924.979000000001,
"heapDeltaBytes": -40963000,
"heapUsedBytes": 198258340,
"domNodes": -6548,
"jsHeapTotalBytes": 9306112,
"scriptDurationMs": 255.931,
"eventListeners": -7461,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 14807.543000000009,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14343.255,
"heapDeltaBytes": -32224308,
"heapUsedBytes": 198129324,
"domNodes": -6548,
"jsHeapTotalBytes": 12390400,
"scriptDurationMs": 268.187,
"eventListeners": -7459,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17726.078999999914,
"styleRecalcs": 144,
"styleRecalcDurationMs": 17.759999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17389.691,
"heapDeltaBytes": -24708716,
"heapUsedBytes": 212303264,
"domNodes": -6548,
"jsHeapTotalBytes": 12058624,
"scriptDurationMs": 801.545,
"eventListeners": -7453,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 19059.23100000007,
"styleRecalcs": 147,
"styleRecalcDurationMs": 19.60300000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 18716.049000000003,
"heapDeltaBytes": -40659148,
"heapUsedBytes": 186374960,
"domNodes": -6548,
"jsHeapTotalBytes": 8167424,
"scriptDurationMs": 880.3129999999999,
"eventListeners": -7451,
"totalBlockingTimeMs": 34,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 508.77300000001924,
"styleRecalcs": 23,
"styleRecalcDurationMs": 22.555,
"layouts": 3,
"layoutDurationMs": 1.46,
"taskDurationMs": 122.42,
"heapDeltaBytes": 5860256,
"heapUsedBytes": 99478584,
"domNodes": 152,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 7.29,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 118.3930000000828,
"styleRecalcs": 8,
"styleRecalcDurationMs": 20.672000000000004,
"layouts": 3,
"layoutDurationMs": 1.3259999999999998,
"taskDurationMs": 95.003,
"heapDeltaBytes": 3688440,
"heapUsedBytes": 97244960,
"domNodes": 108,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 4.744999999999999,
"eventListeners": 51,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
christian-byrne
left a comment
There was a problem hiding this comment.
Redaction works on the real {type, data: {ops}} envelope. Two policy gaps: unanchored key regex over-redacts structural keys; raw-string frame fallback bypasses it. Test fixture does not mirror the wire shape.
Full context for agent readers
Ran the reviewed head in a worktree. pnpm exec vitest run src/workbench/extensions/agent/crdt/devPanelLog.test.ts passes (2/2). Fed a frame shaped exactly like DocFrameClient.sendOps produces ({type: 'doc_ops', data: {v, workflow_id, tab, ops: [...]}}) with a serialized CLIPTextEncode node through recordDevEvent: widgets_values.text, the set_widget value, and named widget values all came out [REDACTED] while op, op_id, node_id, class_type, pos, inputs[].widget.name survived. So the core claim holds on the real envelope, not just the flattened test fixture.
Two gaps in the stated guarantee that secrets never enter the buffer, both small. First, SENSITIVE_KEY = /(token|password|authorization|prompt|text)/i is an unanchored substring match, so properties.context was redacted in my probe and prompt_id (ubiquitous in ComfyUI execution payloads) would be too, which removes exactly the structural metadata the PR body says it preserves. Anchoring to key segments ((^|_)(token|password|authorization|prompt|text)(_|$)) keeps access_token and message_text matching while sparing context and prompt_id. Second, useAgentCrdtFollower.ts L125-127 stores the raw frame string when JSON.parse fails, and sanitizeDetail passes strings through untouched, so an unparsable frame would land in the buffer verbatim. Unreachable from DocFrameClient today (it always sends JSON.stringify output), but it is the one path where the ingestion boundary does not apply.
Nitpick: the fixture puts ops directly under frame while the wire puts it under frame.data; mirroring the real envelope makes the test guard the recursion depth actually exercised.
I will push fixes for the three points to this branch and resolve my own threads.
Match sensitive words only as the last snake_case/camelCase key segment so
structural keys like `context`, `prompt_id`, `class_type`, `token_count`
survive while `access_token`, `accessToken`, `message_text`, `prompt` are
still redacted. Record only the length of an unparsable outbound frame
instead of the raw string, which bypassed the key-based policy. Test
fixture now mirrors the real `{type, data: {ops}}` wire envelope.
|
Pushed 1063164: key match anchored to last segment, raw-frame fallback removed, fixture mirrors wire envelope. All three review threads resolved. Full context for agent readersCommit
Gates on the pushed tree: Note that my original inline suggestion proposed |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## nathaniel/agent-panel-v1 #16659 +/- ##
============================================================
+ Coverage 80.67% 82.98% +2.30%
============================================================
Files 2339 2009 -330
Lines 120790 115776 -5014
Branches 35560 33910 -1650
============================================================
- Hits 97444 96072 -1372
+ Misses 22849 19363 -3486
+ Partials 497 341 -156
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 352 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
CI note: Playwright cloud and mobile-chrome (plus several chromium shards) fail on Full context for agent readersFailing specs: cloud job 100299140155: |
CodeJuggernaut
left a comment
There was a problem hiding this comment.
Redacting at record time is the right layer, and the fixture now matches the real envelope; no issues.
|
Severity: Minor (latent) What: Why this is an issue: Unreachable with today's op shapes, but it sits on a redaction boundary. Proposed Fix: |
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 8 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 2 |
| 🟡 Medium | 3 |
| 🟢 Low | 3 |
Panel: 8/8 reviewers contributed findings.
| return [key, REDACTED] | ||
| } | ||
| if (WIDGET_VALUES_KEYS.has(key)) return [key, redactValues(item)] | ||
| return [key, sanitizeDetail(item, key === 'ops')] |
There was a problem hiding this comment.
🟠 High — sanitizeDetail recurses over arbitrary unknown input with no depth cap and no cycle detection, and recordDevEvent calls it without a try/catch — previously detail was stored by reference and never traversed, so this is a newly introduced throw path. A cyclic detail or a deeply nested server-controlled payload (doc_ops_result.failed / awareness.state are forwarded verbatim from the host) raises RangeError out of the logger; add a WeakSet cycle guard plus a depth limit. Raised by 6 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gemini-3.1-pro adversarial, gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, kimi-k3-max edge-case).
| detail = { delivered, frame: null, unparsed_chars: frame.length } | ||
| } | ||
| recordDevEvent('ws_out', { delivered, frame: parsed }) | ||
| recordDevEvent('ws_out', detail) |
There was a problem hiding this comment.
🟠 High — recordDevEvent now does an unguarded recursive walk inside transport.send, whose documented contract is that it MUST NOT throw. Because the throw happens after apiTransport.send(frame) already put the frame on the wire, a RangeError (or a throwing getter surfaced by Object.entries) aborts the immediate subscribe watcher and the onBeforeUnmount cleanup, and makes a delivered subscribe look unsent. Wrap the log call in try/catch. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial, claude-opus-5-thinking-max edge-case).
|
|
||
| return Object.fromEntries( | ||
| Object.entries(value).map(([key, item]) => { | ||
| if (isSensitiveKey(key) || (redactOpValue && key === 'value')) { |
There was a problem hiding this comment.
🟡 Medium — Op-value redaction is path-dependent: sanitizeDetail(item, key === 'ops') resets rather than propagates the flag (arrays propagate it, objects don't), so a value nested inside an op (ops[i].payload.value, op.config.value) is logged in plaintext while the same value one level up is redacted. Op payloads echoed outside an ops key — doc_ops_result.failed, forwarded verbatim from the wire — never get value redacted at all. Use redactOpValue || key === 'ops'. Raised by 4 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).
| const buffer: DevEvent[] = [] | ||
|
|
||
| function isSensitiveKey(key: string): boolean { | ||
| const snake = key.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase() |
There was a problem hiding this comment.
🟡 Medium — isSensitiveKey only inserts a separator at lower→Upper transitions, so SENSITIVE_KEY's (^|_) anchor never matches keys separated by anything but _: access-token, X-Auth-Token, x-api-key, auth.token and all-caps ACCESSTOKEN are all stored verbatim. Header-style objects are the realistic trigger; normalize -, ., and : to _ as well. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max edge-case).
| } | ||
|
|
||
| function sanitizeDetail(value: unknown, redactOpValue = false): unknown { | ||
| if (value instanceof Uint8Array) return value |
There was a problem hiding this comment.
🟢 Low — instanceof Uint8Array is realm-bound and covers only that one view type: a cross-realm Uint8Array (worker/iframe) or any other typed array falls through to Object.entries and expands an N-byte buffer into an N-key plain object retained in the 500-entry ring buffer, while ArrayBuffer/DataView collapse to {} and lose the byte length that is the only useful thing about them. The matching branch also stores the buffer by reference, so the log pins the caller's binary (for a Yjs update, the full plaintext document) and reflects later mutations. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial, claude-opus-5-thinking-max edge-case).
| // Never store the raw string: `sanitizeDetail` redacts by key, so an | ||
| // unparsable frame would bypass it. Record only its length. | ||
| let detail: Record<string, unknown> | ||
| try { |
There was a problem hiding this comment.
🟢 Low — The "never store the raw string" invariant only holds for unparsable frames: a frame that is a valid JSON primitive (e.g. '"secret"') parses successfully and sanitizeDetail returns primitives untouched, so the raw string lands in the log under the non-sensitive key frame. Reject non-object parse results the same way as a parse failure. Raised by 4 of 8 reviewers (gemini-3.1-pro adversarial, claude-opus-5-thinking-max edge-case, gemini-3.1-pro edge-case, kimi-k3-max edge-case).
|
Superseded by FE #16926 against Full context for agent readersThe redaction fix was re-carried from the original authored commits with The obsolete |
Redacts credentials and workflow payload values before CRDT debug events enter the in-memory buffer. Preserves operation identifiers and structural metadata while summarizing binary payloads by length. Supersedes [FE #16659](#16659), whose base branch was frozen. Re-carried from its Amp- and Christian-authored commits with `git cherry-pick -x`; the automated `processedWidgetRenderModel.ts` formatting-only commit was already empty on `main` and was dropped as required. This successor resolves the source [server-message policy](#16659 (comment)) and [non-plain-object loss](#16659 (comment)) findings. Justification: this is the main-based successor to human-approved FE #16659; Christian authorized carrying that approval through the retarget under [bbc #388](christian-byrne/blocked-on-christian#388 (comment)), conditional on current-main integration, fresh green CI, and an explicit scope/TDD/invariants check. <details><summary>Full context for agent readers</summary> ## Changes - Sanitize every buffered debug-event detail, including credential-shaped keys and operation payload fields. - Bound recursive traversal, handle cycles without throwing, and retain only binary type/length summaries. - Replace malformed or non-object outbound frame content with its character count rather than retaining the raw string. - Preserve event kind, scope, level, sequence, operation IDs, workflow IDs, server error messages, and other structural metadata. - Report sanitizer failures through payload-free error telemetry while failing closed to `[REDACTED]`. - Preserve bounded non-plain-object diagnostics: Error name/message, Map/Set type and size, and Date ISO values. ## Current scope and design fit - Still wanted: the September 1 Agent sync explicitly retained the temporary feature-flagged CRDT panel so testers can copy diagnostic logs into bug reports; V1 scope still lists user-visible CRDT failure reporting and alpha observability as partial work. - TDD: serves `plans/technical-design.md` §6's migration to the semantic CRDT path and §7's security/correctness boundary. The debug transcript observes the current `doc_ops`/host-update path; it does not revive the stale §5 `draft_patch` mutation model. - Preserved invariants: CRDT KEEP-ALIVE #1 (semantic ops remain the replication unit), #2 (`op_id`/structural identity remains visible), and #6 (raw Yjs updates remain host-to-follower only). Sanitization changes only the in-memory diagnostic copy and never the wire frame, applier, document, operation ordering, or persistence path. Credentials and content-bearing values are removed before buffering or copy-out. ## Evidence - Branch rebased onto current `main` at [`1e22cf8fb`](1e22cf8); resulting head [`4a0041858`](4a00418). - `pnpm test:unit src/workbench/extensions/agent/crdt` — 30 files passed, 406 tests passed, including current-main clipboard integration. - `pnpm typecheck` — passed after the rebase. - `pnpm exec oxfmt --check <five PR files>` — passed. - `pnpm exec oxlint --type-aware <five PR files>` — 0 warnings, 0 errors. - `pnpm exec eslint --cache --no-warn-ignored <five PR files>` — passed. - Commit hooks and push hooks, including typecheck and `knip --cache` — passed. - All three CodeRabbit findings were fixed, replied to with evidence, and resolved. - Both exact #16659 source findings were dispositioned with evidence and their automated review threads resolved. - The current-main clipboard truncation test now uses a non-sensitive description field, preserving both full-copy coverage and the carrier’s requirement that `value` never enters display or clipboard output. Original lane attribution: `lane-fec-redact-1`. </details> <!-- authored-by:agent lane-prbase-2-0627 --> --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: GitHub Action <action@github.com>
Redacts sensitive CRDT dev-panel payload values before buffering.
Preserves event and operation metadata plus binary lengths.
Focused tests and typecheck are green.
Full context for agent readers
Summary
Sanitizes CRDT dev-panel event details at the ingestion boundary so secrets never enter the module-level buffer or serialized output.
Changes
Review Focus
Check that the key-based policy covers diagnostic payloads without removing structural metadata. The 500-event capacity and panel UI are unchanged.
Evidence
pnpm test:unit src/workbench/extensions/agent/crdt/devPanelLog.test.ts— 1 file passed, 2 tests passed.pnpm typecheck—vue-tsc --noEmitexited 0.pnpm exec oxfmt --check src/workbench/extensions/agent/crdt/devPanelLog.ts src/workbench/extensions/agent/crdt/devPanelLog.test.ts— both files correctly formatted.pnpm exec oxlint src/workbench/extensions/agent/crdt/devPanelLog.ts src/workbench/extensions/agent/crdt/devPanelLog.test.ts— 0 warnings, 0 errors.