fix: return undefined for muted node output resolution (#9302)

## Summary

Muted (NEVER mode) subgraph nodes throw "No inner node DTO found" during
prompt serialization because `resolveOutput()` falls through to subgraph
resolution for nodes whose inner DTOs were never registered.

## Changes

- **What**: Add early return in `ExecutableNodeDTO.resolveOutput()` for
`NEVER` mode nodes, matching the existing `BYPASS` mode guard. Add 5
tests covering muted, bypassed, and normal mode resolution.

## Review Focus

The fix is a single-line early return. The key insight is that
`graphToPrompt` in `executionUtil.ts` correctly skips `getInnerNodes()`
for muted/bypassed nodes, so their inner DTOs are never in the map — but
`resolveOutput()` was missing the corresponding guard for `NEVER` mode.

Fixes #8986

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9302-fix-return-undefined-for-muted-node-output-resolution-3156d73d3650811e9697c7281f11cf96)
by [Unito](https://www.unito.io)
This commit is contained in:
Christian Byrne
2026-03-12 17:44:32 -07:00
committed by GitHub
parent 4337b8d6c6
commit f5363e4028
4 changed files with 170 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
import { createTestingPinia } from '@pinia/testing'
import { setActivePinia } from 'pinia'
import { beforeEach, describe, expect, it } from 'vitest'
import {
LGraph,
LGraphNode,
LGraphEventMode
} from '@/lib/litegraph/src/litegraph'
import { ExecutableGroupNodeDTO } from './executableGroupNodeDto'
describe('Muted group node output resolution', () => {
beforeEach(() => {
setActivePinia(createTestingPinia({ stubActions: false }))
})
it('should return undefined for NEVER mode group nodes', () => {
const graph = new LGraph()
const node = new LGraphNode('Muted Group')
node.addOutput('out', 'IMAGE')
node.mode = LGraphEventMode.NEVER
graph.add(node)
const dto = new ExecutableGroupNodeDTO(node, [], new Map(), undefined)
const resolved = dto.resolveOutput(0, 'IMAGE', new Set())
expect(resolved).toBeUndefined()
})
})

View File

@@ -24,6 +24,9 @@ export class ExecutableGroupNodeDTO extends ExecutableNodeDTO {
}
override resolveOutput(slot: number, type: ISlotType, visited: Set<string>) {
// Muted nodes produce no output
if (this.mode === LGraphEventMode.NEVER) return
// Temporary duplication: Bypass nodes are bypassed using the first input with matching type
if (this.mode === LGraphEventMode.BYPASS) {
const { inputs } = this