From ba7ea6e3bf39f67fbe11f3ee01fad05fb8290707 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Wed, 4 Nov 2026 07:30:13 -0800 Subject: [PATCH 1/5] fix(agent): declare a frontend-only node's own widget form so its widgets stay editable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A node whose class the pinned widget catalog cannot describe was minted with a positional `widgets_values` and no `widgets_values_form`, so the doc host stored it under `__widgets_opaque`. Opaque storage has no name-to-position mapping, so every later `set_widget` against the node is refused `opaque_widgets` for the node's whole lifetime: the follower reports the refusal and rolls the live value back, and the widget is read-only. `Note` is the clearest case and it needs no custom node. The catalog is an `object_info` projection and `Note` is rendered entirely by the frontend, so it can never hold a catalog entry and there is no catalog fix available. The user-visible result is that typing in a sticky note is reverted to empty with an error toast. The `isVirtualNode` carve-out this replaces was correct when it was written: a name-keyed record for an uncatalogued class was refused outright, so shipping the positional array was the only thing that worked. Schema A24's declared form now makes such a class name-addressable with no catalog at all, which is what #21479 enabled for every non-virtual node and what the virtual arm never got. Opaque storage is not a neutral fallback for it. Subgraph hosts stay excluded, and that is now the guard's actual subject: the document stores their promoted values as a positional array and `applyHostWidgets` indexes and counts that array against the live promoted inputs. Nothing relaxes KA-12 — `provenWidgetValuesForm` still declares a form only where it can prove one, and an unprovable class keeps the positional array and the loud refusal it has today. Measured: 17 `opaque_widgets` refusals across 14 users in the 28 hours to 2026-11-04T14:31Z on release 1.59.5, over `VHS_*` (10), `Note` (3) and `MiniMax*` (4) classes. Linear: PM-2371 --- .../agent/agentHumanNoteWidgetWrite.spec.ts | 201 ++++++++++++++++++ .../extensions/agent/crdt/docOpMinter.test.ts | 32 ++- .../extensions/agent/crdt/docOpMinter.ts | 31 ++- ...gentCrdtFollower.humanAddTabSwitch.test.ts | 5 +- 4 files changed, 261 insertions(+), 8 deletions(-) create mode 100644 browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts diff --git a/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts b/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts new file mode 100644 index 00000000000..759608eb16e --- /dev/null +++ b/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts @@ -0,0 +1,201 @@ +import { expect, mergeTests } from '@playwright/test' +import type { Page, WebSocketRoute } from '@playwright/test' +import type { WidgetCatalog } from '@comfyorg/comfy-multi-player' + +import { + BLANK_WORKFLOW, + agentTest, + bootAgentApp, + loadIntoBootWorkflow, + mockAgentTurnApi, + mockWorkflowPersistence +} from '@e2e/fixtures/agentPanelFixture' +import { HostDoc } from '@e2e/fixtures/agentConversationHostDoc' +import type { WireOpEnvelope } from '@e2e/fixtures/agentWireFrame' +import { AgentPanel } from '@e2e/fixtures/components/AgentPanel' +import { subscribeAgentWorkflow } from '@e2e/fixtures/utils/subscribeAgentWorkflow' +import { nextFrame } from '@e2e/fixtures/utils/timing' +import { VueNodeHelpers } from '@e2e/fixtures/VueNodeHelpers' +import { webSocketFixture } from '@e2e/fixtures/ws' + +const test = mergeTests(agentTest, webSocketFixture) + +const WORKFLOW_ID = 'c7a21d40-0000-4000-8000-000000000050' +const MESSAGE_ID = 'c7a21d40-0000-4000-8000-000000000051' +const THREAD_ID = 'c7a21d40-0000-4000-8000-000000000052' + +const TYPED_NOTE = 'remember to swap the LoRA before the final render' + +/** + * Deliberately EMPTY, and that is the point of this spec rather than a + * shortcut. The pinned catalog is a projection of `object_info`, and `Note` is + * rendered entirely by the frontend — it never appears in `object_info`, so no + * catalog derived from one can ever describe it. There is no catalog fix + * available for this class, which is why the node's own declared + * `widgets_values_form` is the only thing that can keep it writable. + */ +const catalog: WidgetCatalog = { types: {} } + +interface OpsFrame { + type: string + data: { ops?: WireOpEnvelope[] } +} + +function docOpsFrames(frames: readonly string[]): OpsFrame[] { + return frames + .map((frame) => JSON.parse(frame) as OpsFrame) + .filter((frame) => frame.type === 'doc_ops') +} + +/** + * Hands one outbound client batch to the real applier and sends back whatever + * it actually answered. + * + * The verdict is never fabricated here: `HostDoc.applyWire` runs + * `@comfyorg/comfy-multi-player`'s `applyOps` against a real document and the + * `doc_ops_result` frame carries that run's own code. So a rejection in this + * spec is the production rejection, not a stand-in for one. + */ +function relayToHost( + host: HostDoc, + socket: WebSocketRoute, + ops: WireOpEnvelope[] +): void { + const { result, update } = host.applyWire(ops) + socket.send(JSON.stringify(result)) + if (update !== null) socket.send(JSON.stringify(update)) +} + +async function bootWithHost( + page: Page, + getAgentSocket: () => Promise +) { + await page.setViewportSize({ width: 1920, height: 1280 }) + await page.addInitScript(() => { + localStorage.setItem('Comfy.Agent.CrdtFollower', 'true') + }) + await bootAgentApp(page, true, { + objectInfo: {}, + beforeNavigate: async (page) => { + await mockAgentTurnApi(page, { + message_id: MESSAGE_ID, + thread_id: THREAD_ID, + workflow_id: WORKFLOW_ID + }) + await mockWorkflowPersistence(page, WORKFLOW_ID) + } + }) + await loadIntoBootWorkflow(page, BLANK_WORKFLOW) + + const agentPanel = new AgentPanel(page) + await agentPanel.open() + const socket = await getAgentSocket() + const outboundFrames = await subscribeAgentWorkflow({ + agentPanel, + socket, + workflowId: WORKFLOW_ID, + prompt: 'Leave the canvas to me' + }) + + const host = new HostDoc(WORKFLOW_ID, { nodes: [], links: [] }, catalog) + for (const frame of host.initialSync()) socket.send(JSON.stringify(frame)) + await expect + .poll(() => page.evaluate(() => window.app!.graph.nodes.length)) + .toBe(0) + + return { host, socket, outboundFrames, vueNodes: new VueNodeHelpers(page) } +} + +test.describe( + 'A human edit to a frontend-only node the catalog cannot describe', + { tag: ['@cloud', '@agent', '@canvas', '@node', '@widget', '@vue-nodes'] }, + () => { + test.use({ connectWebSocketToServer: false }) + test.describe.configure({ timeout: 90_000 }) + + // Red before the fix: the add ships a positional `widgets_values`, the + // host stores it under `__widgets_opaque` because `Note` has no + // `widget_order`, and the real applier then refuses the edit + // `opaque_widgets` — the follower reports it and rolls the text back, so + // the sticky note cannot be typed in at all. PM-2371. + test('keeps the text the user typed into a Note, with no rejection notice', async ({ + page, + toast, + getAgentSocket + }) => { + const { host, socket, outboundFrames, vueNodes } = await bootWithHost( + page, + getAgentSocket + ) + + const beforeAdd = outboundFrames.length + await page.evaluate(() => { + window.app!.graph.add(window.LiteGraph!.createNode('Note')!) + }) + await expect + .poll(() => outboundFrames.slice(beforeAdd), { timeout: 15_000 }) + .toContainEqual(expect.stringContaining('"op":"add_node"')) + for (const frame of docOpsFrames(outboundFrames.slice(beforeAdd))) + relayToHost(host, socket, frame.data.ops ?? []) + await nextFrame(page) + + const noteId = await page.evaluate( + () => + window.app!.graph.nodes.find((node) => node.type === 'Note')?.id ?? + null + ) + expect(noteId).not.toBeNull() + + await page + .getByRole('button', { name: 'Fit View (.)', exact: true }) + .click() + const noteText = vueNodes + .getNodeLocator(String(noteId)) + .getByLabel('text', { exact: true }) + + const beforeEdit = outboundFrames.length + await noteText.fill(TYPED_NOTE) + await noteText.blur() + + await expect + .poll(() => outboundFrames.slice(beforeEdit), { timeout: 15_000 }) + .toContainEqual(expect.stringContaining('"op":"set_widget"')) + for (const frame of docOpsFrames(outboundFrames.slice(beforeEdit))) + relayToHost(host, socket, frame.data.ops ?? []) + await nextFrame(page) + await nextFrame(page) + + // The user-visible outcome, which is the whole assertion: the text they + // typed is still on the note. Before the fix the follower put the + // document's value back and this read the empty default. + await expect(noteText).toHaveValue(TYPED_NOTE) + + // And the shared document agrees, so a reload or another tab shows the + // same note rather than silently dropping the edit. + // + // Name-keyed, beside the form the producer declared: that is the A24 + // round trip, not an accident of this spec. The node is stored under the + // `self` strategy, so `project()` re-emits the shape the producer sent + // rather than a positional array it would need a catalog to rebuild. + // The saved workflow file is untouched by this — it comes from + // `graph.serialize()`, which still writes `["…"]`. + const stored = host + .projection() + .nodes.find((node) => String(node.id) === String(noteId)) + expect(stored).toMatchObject({ + type: 'Note', + widgets_values: { text: TYPED_NOTE }, + widgets_values_form: { order: ['text'] } + }) + + // No "rejected" notice, because nothing was rejected. Filtered to the + // text and required absent on screen, the inverse of the assertion the + // duplicate-insert spec makes for a genuinely refused write. + await expect( + toast.toastErrors.filter({ + hasText: 'Widget edit was rejected and was not saved' + }) + ).toHaveCount(0) + }) + } +) diff --git a/src/workbench/extensions/agent/crdt/docOpMinter.test.ts b/src/workbench/extensions/agent/crdt/docOpMinter.test.ts index dd7aa3fb042..789ae667b29 100644 --- a/src/workbench/extensions/agent/crdt/docOpMinter.test.ts +++ b/src/workbench/extensions/agent/crdt/docOpMinter.test.ts @@ -727,10 +727,13 @@ describe('attachDocOpMinter', () => { ).not.toHaveProperty('ghost') }) - // Note, PrimitiveNode, Get/Set nodes and blueprint hosts have no catalog - // entry: the applier rejects a name-keyed record for them and stores a - // positional array opaquely. - it('keeps add_node widgets_values positional for a frontend-only node, and the applier takes it', async () => { + // A frontend-only class (Note, MarkdownNote) can never hold a catalog entry, + // because the catalog is an `object_info` projection and these classes never + // appear in `object_info`. A24's declared form is the only thing that makes + // one name-addressable, so the add must carry it: storing the positional + // array opaquely instead makes every later widget write unsatisfiable + // (`opaque_widgets`), which is the whole-class edit loss PM-2371 reports. + it('declares a frontend-only node own widget form, so the applier takes a later widget write', async () => { const note = new TestNote() graph.add(note) await afterFlush() @@ -739,7 +742,10 @@ describe('attachDocOpMinter', () => { expect.objectContaining({ op: 'add_node', class_type: 'TestNote', - node: expect.objectContaining({ widgets_values: ['a note'] }) + node: expect.objectContaining({ + widgets_values: { text: 'a note' }, + widgets_values_form: { order: ['text'] } + }) }) ]) const doc = mint({ nodes: [], links: [] }, CATALOG) @@ -749,6 +755,22 @@ describe('attachDocOpMinter', () => { CATALOG ) expect(outcomes).toEqual([expect.objectContaining({ outcome: 'applied' })]) + + expect( + applyOutcomes( + doc, + [ + { + op: 'set_widget', + node_id: note.id, + widget: 'text', + value: 'edited' + } + ], + CATALOG, + 2 + ) + ).toEqual([expect.objectContaining({ outcome: 'applied' })]) doc.destroy() }) diff --git a/src/workbench/extensions/agent/crdt/docOpMinter.ts b/src/workbench/extensions/agent/crdt/docOpMinter.ts index 303ffa51b54..2711201e97d 100644 --- a/src/workbench/extensions/agent/crdt/docOpMinter.ts +++ b/src/workbench/extensions/agent/crdt/docOpMinter.ts @@ -191,7 +191,34 @@ interface PendingWidgetValue { type MissingSlotGrowth = NonNullable> -/** Returns the node's save-format snapshot for a semantic add operation. */ +/** + * Returns the node's save-format snapshot for a semantic add operation. + * + * A SUBGRAPH HOST is the one node whose widget values are positional by + * design, so it is the one node excluded from the name-keyed/declared-form + * path. The document stores its promoted values as a positional array and + * `applyHostWidgets` indexes that array against the live promoted inputs, + * checking cardinality as it goes; a name-keyed record would have no array to + * index and nothing to count. + * + * Every OTHER frontend-only class is included, and that is a change from the + * pre-A24 rule this replaced (`isVirtualNode`). That rule was written when a + * name-keyed record for an uncatalogued class was refused outright, so + * shipping the positional array and letting the host store it opaquely was + * the only thing that worked. A declared `widgets_values_form` now makes such + * a class name-addressable with no catalog at all (schema A24), and opaque + * storage is not a neutral fallback: it is the one storage strategy that can + * never be written by name, so every later widget edit on the node is + * refused `opaque_widgets` for the node's whole lifetime. `Note` is the clear + * case — a core class that can never hold a catalog entry, because the + * catalog is an `object_info` projection and `Note` never appears in + * `object_info` — and the symptom is that typing in a sticky note is rejected + * and rolled back. PM-2371. + * + * Nothing here relaxes KA-12. `provenWidgetValuesForm` still declares a form + * only where it can prove one, and a class with no proof keeps the positional + * array and the loud refusal it has today. + */ export function wireNodeSnapshot(node: LGraphNode): WorkflowNode | null { let serialized: ISerialisedNode try { @@ -208,7 +235,7 @@ export function wireNodeSnapshot(node: LGraphNode): WorkflowNode | null { ...rest } = wireSerialized const snapshot = { ...rest, flags } satisfies WorkflowNode - if (!named || node.isVirtualNode) return snapshot + if (!named || node.isSubgraphNode()) return snapshot const values = valueWidgetsOnly(node, named) // The form is proven against the POST-HOOK serialization, not derived from // the live widget list alone: `serialize()` above already ran the extension diff --git a/src/workbench/extensions/agent/crdt/useAgentCrdtFollower.humanAddTabSwitch.test.ts b/src/workbench/extensions/agent/crdt/useAgentCrdtFollower.humanAddTabSwitch.test.ts index df2cc885f3f..5a9608dba2c 100644 --- a/src/workbench/extensions/agent/crdt/useAgentCrdtFollower.humanAddTabSwitch.test.ts +++ b/src/workbench/extensions/agent/crdt/useAgentCrdtFollower.humanAddTabSwitch.test.ts @@ -186,9 +186,12 @@ describe('a human-added node across a tab switch', () => { widgetsValues: { steps: 20 } }, { + // Name-keyed, not positional: a frontend-only class can never hold a + // catalog entry, so its own declared form is the only thing that keeps + // it name-addressable and therefore editable at all (PM-2371). name: 'a frontend-only (virtual) node', type: 'TestVirtual', - widgetsValues: ['x'] + widgetsValues: { name: 'x' } } ])( 'keeps $name and delivers a batch queued behind its in-flight add across a tab switch with an advancing host', From d199ec956b7985e37657bd71d8076b797f21efac Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 4 Nov 2026 15:34:56 +0000 Subject: [PATCH 2/5] [automated] Apply ESLint and Oxfmt fixes --- browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts b/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts index 759608eb16e..7cd2849fc5c 100644 --- a/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts +++ b/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts @@ -130,7 +130,7 @@ test.describe( const beforeAdd = outboundFrames.length await page.evaluate(() => { - window.app!.graph.add(window.LiteGraph!.createNode('Note')!) + window.app!.graph.add(window.LiteGraph!.createNode('Note')) }) await expect .poll(() => outboundFrames.slice(beforeAdd), { timeout: 15_000 }) From 482225983f21db581d6766ea942362f7e65d3b17 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Wed, 4 Nov 2026 09:26:46 -0800 Subject: [PATCH 3/5] fix(agent): keep the positional fallback for virtual nodes whose widget form cannot be proven (PM-2371) --- .../agent/agentHumanNoteWidgetWrite.spec.ts | 17 -------- .../extensions/agent/crdt/docOpMinter.test.ts | 6 --- .../extensions/agent/crdt/docOpMinter.ts | 41 +++++++------------ ...gentCrdtFollower.humanAddTabSwitch.test.ts | 3 -- 4 files changed, 14 insertions(+), 53 deletions(-) diff --git a/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts b/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts index 7cd2849fc5c..cd85fde0e8d 100644 --- a/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts +++ b/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts @@ -26,14 +26,6 @@ const THREAD_ID = 'c7a21d40-0000-4000-8000-000000000052' const TYPED_NOTE = 'remember to swap the LoRA before the final render' -/** - * Deliberately EMPTY, and that is the point of this spec rather than a - * shortcut. The pinned catalog is a projection of `object_info`, and `Note` is - * rendered entirely by the frontend — it never appears in `object_info`, so no - * catalog derived from one can ever describe it. There is no catalog fix - * available for this class, which is why the node's own declared - * `widgets_values_form` is the only thing that can keep it writable. - */ const catalog: WidgetCatalog = { types: {} } interface OpsFrame { @@ -47,15 +39,6 @@ function docOpsFrames(frames: readonly string[]): OpsFrame[] { .filter((frame) => frame.type === 'doc_ops') } -/** - * Hands one outbound client batch to the real applier and sends back whatever - * it actually answered. - * - * The verdict is never fabricated here: `HostDoc.applyWire` runs - * `@comfyorg/comfy-multi-player`'s `applyOps` against a real document and the - * `doc_ops_result` frame carries that run's own code. So a rejection in this - * spec is the production rejection, not a stand-in for one. - */ function relayToHost( host: HostDoc, socket: WebSocketRoute, diff --git a/src/workbench/extensions/agent/crdt/docOpMinter.test.ts b/src/workbench/extensions/agent/crdt/docOpMinter.test.ts index 789ae667b29..b317294929a 100644 --- a/src/workbench/extensions/agent/crdt/docOpMinter.test.ts +++ b/src/workbench/extensions/agent/crdt/docOpMinter.test.ts @@ -727,12 +727,6 @@ describe('attachDocOpMinter', () => { ).not.toHaveProperty('ghost') }) - // A frontend-only class (Note, MarkdownNote) can never hold a catalog entry, - // because the catalog is an `object_info` projection and these classes never - // appear in `object_info`. A24's declared form is the only thing that makes - // one name-addressable, so the add must carry it: storing the positional - // array opaquely instead makes every later widget write unsatisfiable - // (`opaque_widgets`), which is the whole-class edit loss PM-2371 reports. it('declares a frontend-only node own widget form, so the applier takes a later widget write', async () => { const note = new TestNote() graph.add(note) diff --git a/src/workbench/extensions/agent/crdt/docOpMinter.ts b/src/workbench/extensions/agent/crdt/docOpMinter.ts index 2711201e97d..1c886395713 100644 --- a/src/workbench/extensions/agent/crdt/docOpMinter.ts +++ b/src/workbench/extensions/agent/crdt/docOpMinter.ts @@ -194,30 +194,11 @@ type MissingSlotGrowth = NonNullable> /** * Returns the node's save-format snapshot for a semantic add operation. * - * A SUBGRAPH HOST is the one node whose widget values are positional by - * design, so it is the one node excluded from the name-keyed/declared-form - * path. The document stores its promoted values as a positional array and - * `applyHostWidgets` indexes that array against the live promoted inputs, - * checking cardinality as it goes; a name-keyed record would have no array to - * index and nothing to count. - * - * Every OTHER frontend-only class is included, and that is a change from the - * pre-A24 rule this replaced (`isVirtualNode`). That rule was written when a - * name-keyed record for an uncatalogued class was refused outright, so - * shipping the positional array and letting the host store it opaquely was - * the only thing that worked. A declared `widgets_values_form` now makes such - * a class name-addressable with no catalog at all (schema A24), and opaque - * storage is not a neutral fallback: it is the one storage strategy that can - * never be written by name, so every later widget edit on the node is - * refused `opaque_widgets` for the node's whole lifetime. `Note` is the clear - * case — a core class that can never hold a catalog entry, because the - * catalog is an `object_info` projection and `Note` never appears in - * `object_info` — and the symptom is that typing in a sticky note is rejected - * and rolled back. PM-2371. - * - * Nothing here relaxes KA-12. `provenWidgetValuesForm` still declares a form - * only where it can prove one, and a class with no proof keeps the positional - * array and the loud refusal it has today. + * Excludes only subgraph hosts, whose widget values are positional by design + * (`applyHostWidgets` indexes them against the live promoted inputs). Every + * other named-value node gets a declared `widgets_values_form` when one can + * be proven (schema A24); otherwise it keeps the positional snapshot rather + * than shipping an undeclared name-keyed record (KA-12). */ export function wireNodeSnapshot(node: LGraphNode): WorkflowNode | null { let serialized: ISerialisedNode @@ -241,9 +222,15 @@ export function wireNodeSnapshot(node: LGraphNode): WorkflowNode | null { // the live widget list alone: `serialize()` above already ran the extension // serialize hook, which may have replaced either widget-values field. const form = provenWidgetValuesForm(node, values, serialized) - return form - ? { ...snapshot, widgets_values: values, widgets_values_form: form } - : { ...snapshot, widgets_values: values } + if (form) + return { ...snapshot, widgets_values: values, widgets_values_form: form } + // A catalogued class (e.g. a dynamic combo, whose value-dependent layout + // suppresses proof deliberately) still resolves named values through the + // catalog on the receiving end. An uncatalogued virtual node has no catalog + // to fall back on, so a name-keyed write with no declared form would reject + // the whole add_node (`uncatalogued_widget_write`) instead of landing + // opaquely as it did before this node type gained the A24 path. + return node.isVirtualNode ? snapshot : { ...snapshot, widgets_values: values } } function nodeKey(graphId: string, nodeId: NodeId): string { diff --git a/src/workbench/extensions/agent/crdt/useAgentCrdtFollower.humanAddTabSwitch.test.ts b/src/workbench/extensions/agent/crdt/useAgentCrdtFollower.humanAddTabSwitch.test.ts index 5a9608dba2c..48c98a45220 100644 --- a/src/workbench/extensions/agent/crdt/useAgentCrdtFollower.humanAddTabSwitch.test.ts +++ b/src/workbench/extensions/agent/crdt/useAgentCrdtFollower.humanAddTabSwitch.test.ts @@ -186,9 +186,6 @@ describe('a human-added node across a tab switch', () => { widgetsValues: { steps: 20 } }, { - // Name-keyed, not positional: a frontend-only class can never hold a - // catalog entry, so its own declared form is the only thing that keeps - // it name-addressable and therefore editable at all (PM-2371). name: 'a frontend-only (virtual) node', type: 'TestVirtual', widgetsValues: { name: 'x' } From f801c49105e585d4e1c253a66ba14e0c30ded66b Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Wed, 4 Nov 2026 10:25:39 -0800 Subject: [PATCH 4/5] test(agent): drop the explanatory comments from the Note widget-write spec The spec's rationale moves to the PR description, per the repo comment guideline that a diff adds no comments other than curt JSDoc on exported APIs. No behavioural change: comment deletions only. --- .../agent/agentHumanNoteWidgetWrite.spec.ts | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts b/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts index cd85fde0e8d..c9c51a02847 100644 --- a/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts +++ b/browser_tests/tests/agent/agentHumanNoteWidgetWrite.spec.ts @@ -96,11 +96,6 @@ test.describe( test.use({ connectWebSocketToServer: false }) test.describe.configure({ timeout: 90_000 }) - // Red before the fix: the add ships a positional `widgets_values`, the - // host stores it under `__widgets_opaque` because `Note` has no - // `widget_order`, and the real applier then refuses the edit - // `opaque_widgets` — the follower reports it and rolls the text back, so - // the sticky note cannot be typed in at all. PM-2371. test('keeps the text the user typed into a Note, with no rejection notice', async ({ page, toast, @@ -148,20 +143,8 @@ test.describe( await nextFrame(page) await nextFrame(page) - // The user-visible outcome, which is the whole assertion: the text they - // typed is still on the note. Before the fix the follower put the - // document's value back and this read the empty default. await expect(noteText).toHaveValue(TYPED_NOTE) - // And the shared document agrees, so a reload or another tab shows the - // same note rather than silently dropping the edit. - // - // Name-keyed, beside the form the producer declared: that is the A24 - // round trip, not an accident of this spec. The node is stored under the - // `self` strategy, so `project()` re-emits the shape the producer sent - // rather than a positional array it would need a catalog to rebuild. - // The saved workflow file is untouched by this — it comes from - // `graph.serialize()`, which still writes `["…"]`. const stored = host .projection() .nodes.find((node) => String(node.id) === String(noteId)) @@ -171,9 +154,6 @@ test.describe( widgets_values_form: { order: ['text'] } }) - // No "rejected" notice, because nothing was rejected. Filtered to the - // text and required absent on screen, the inverse of the assertion the - // duplicate-insert spec makes for a genuinely refused write. await expect( toast.toastErrors.filter({ hasText: 'Widget edit was rejected and was not saved' From 235be5bec67367d12d8fc6ded6b13ffab9ca1bda Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Wed, 4 Nov 2026 11:04:53 -0800 Subject: [PATCH 5/5] fix(agent): drop the remaining inline comments from wireNodeSnapshot Both rationales move to the PR description, per the repo comment guideline that a diff adds no comments other than curt JSDoc on exported APIs. No behavioural change: comment deletions only. --- src/workbench/extensions/agent/crdt/docOpMinter.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/workbench/extensions/agent/crdt/docOpMinter.ts b/src/workbench/extensions/agent/crdt/docOpMinter.ts index 1c886395713..62f134057d7 100644 --- a/src/workbench/extensions/agent/crdt/docOpMinter.ts +++ b/src/workbench/extensions/agent/crdt/docOpMinter.ts @@ -218,18 +218,9 @@ export function wireNodeSnapshot(node: LGraphNode): WorkflowNode | null { const snapshot = { ...rest, flags } satisfies WorkflowNode if (!named || node.isSubgraphNode()) return snapshot const values = valueWidgetsOnly(node, named) - // The form is proven against the POST-HOOK serialization, not derived from - // the live widget list alone: `serialize()` above already ran the extension - // serialize hook, which may have replaced either widget-values field. const form = provenWidgetValuesForm(node, values, serialized) if (form) return { ...snapshot, widgets_values: values, widgets_values_form: form } - // A catalogued class (e.g. a dynamic combo, whose value-dependent layout - // suppresses proof deliberately) still resolves named values through the - // catalog on the receiving end. An uncatalogued virtual node has no catalog - // to fall back on, so a name-keyed write with no declared form would reject - // the whole add_node (`uncatalogued_widget_write`) instead of landing - // opaquely as it did before this node type gained the A24 path. return node.isVirtualNode ? snapshot : { ...snapshot, widgets_values: values } }