From b8c2e91f80e769f739d614d9f625c3671793fc47 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Wed, 7 Oct 2026 17:45:28 +0000 Subject: [PATCH] fix(execution): queue Agent-inserted selected outputs (#20437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What Allow **Queue Selected Output Nodes** to execute an Agent-inserted root output whose raw node ID contains colons, such as `insert::root:node:`. `getExecutionIdsForSelectedNodes()` still used strict multi-segment execution-ID construction for the root leaf. That returns `null` for the colon-bearing IDs created by `insert_workflow`, so selecting the inserted `SaveImage` output produced “Could not resolve path to selected nodes” even though the full workflow validated and was ready to run. The root case now uses the existing `createLeafNodeExecutionId()` contract added for PM-1580. Nested paths remain on the strict delimiter-aware path. ## User evidence - Production Agent feedback surfaced 2026-10-07 from a `prod-v2` session on Agent release `v0.381.0`. - The affected workflow came from an Agent-inserted Krea template and had root IDs in the `insert:...:root:node:...` form. - Agent-side validation reported 22 converted nodes, zero errors/warnings, `ready_to_run: true`, and `spends_credits: false`; selected-output queueing failed before execution. - Related earlier locator/callback repair: #18616 / PM-1580. This closes the analogous selected-output execution helper gap. ## Test plan - `pnpm vitest run src/utils/graphTraversalUtil.test.ts` — 115 passed - `pnpm exec oxfmt --check src/utils/graphTraversalUtil.ts src/utils/graphTraversalUtil.test.ts` - `pnpm exec oxlint --type-aware src/utils/graphTraversalUtil.ts src/utils/graphTraversalUtil.test.ts` - `pnpm exec eslint --no-cache src/utils/graphTraversalUtil.ts src/utils/graphTraversalUtil.test.ts` - `pnpm typecheck:app` - Commit and push hooks passed, including the changed-file fallow audit. No feature flag, exposure, workflow content, model choice, or credit behavior changes. --- src/utils/graphTraversalUtil.test.ts | 9 +++++++++ src/utils/graphTraversalUtil.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/graphTraversalUtil.test.ts b/src/utils/graphTraversalUtil.test.ts index dbe5cf2f7e4..cc64619d01e 100644 --- a/src/utils/graphTraversalUtil.test.ts +++ b/src/utils/graphTraversalUtil.test.ts @@ -1539,6 +1539,15 @@ describe('graphTraversalUtil', () => { expect(executionIds).toEqual(['789', '456', '123']) // DFS processes in LIFO order }) + it('should keep a colon-bearing root node ID whole', () => { + const graph = createMockGraph([]) + const node = createMockNode('insert:op-123:root:node:29', { graph }) + + const executionIds = getExecutionIdsForSelectedNodes([node]) + + expect(executionIds).toEqual(['insert:op-123:root:node:29']) + }) + it('should expand subgraph nodes to include all children', () => { const graph = createMockGraph([]) const subNodes = [createMockNode('10'), createMockNode('11')] diff --git a/src/utils/graphTraversalUtil.ts b/src/utils/graphTraversalUtil.ts index 3fecacb2022..bb12db8b37d 100644 --- a/src/utils/graphTraversalUtil.ts +++ b/src/utils/graphTraversalUtil.ts @@ -948,7 +948,7 @@ export function getExecutionIdsForSelectedNodes( node: LGraphNode, parentExecutionId: string | null ): NodeExecutionId | null { - if (!parentExecutionId) return createNodeExecutionId([node.id]) + if (!parentExecutionId) return createLeafNodeExecutionId(node.id) return createExecutionIdFromPath(parentExecutionId, node.id) }