Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/utils/graphTraversalUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')]
Expand Down
2 changes: 1 addition & 1 deletion src/utils/graphTraversalUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ export function getExecutionIdsForSelectedNodes(
node: LGraphNode,
parentExecutionId: string | null
): NodeExecutionId | null {
if (!parentExecutionId) return createNodeExecutionId([node.id])
if (!parentExecutionId) return createLeafNodeExecutionId(node.id)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): this is the right change, but it's the second time this exact root-leaf case has been patched one call site at a time, and two more are still strict in this same file:

  • getExecutionIdByNode (line 483): if (node.graph === rootGraph || node.graph.isRootGraph) return createNodeExecutionId([node.id])
  • getExecutionIdForNodeInGraph (line 606): const localExecutionId = createNodeExecutionId([localNodeId]), returned directly on the graph === rootGraph || graph.isRootGraph branch

Both have the identical shape your change fixes — no ancestor path, strict single-segment construction — so both still return null for an Agent-inserted root node. getExecutionIdByNode in particular feeds executionErrorStore.ts, useErrorGroups.ts, missingModelScan.ts, missingMediaScan.ts, missingNodeScan.ts, and RightSidePanel.vue. For the same Krea-template workflow in the report, that would mean execution errors not attributing to the node and missing-model/media scans skipping it — the same class of bug as this one, just on surfaces nobody has filed yet.

executionIdFromState (line 631-635) already carries the fixed ternary plus the explanatory comment from PM-1580, so after this PR it's 2 of 4 done.

Rather than a third round, would it make sense to push the decision down one level — have the "no ancestor path ⇒ keep the raw id whole" rule live inside the helper, so callers can't pick the wrong one? That's a property of the contract, not of each call site, and it's what the createLeafNodeExecutionId docstring already describes. Happy for that to be a follow-up if you'd rather keep this PR tight to the production report — just flagging it so the remaining two don't wait for another user to hit them.


return createExecutionIdFromPath(parentExecutionId, node.id)
}
Expand Down
Loading