@@ -131,7 +131,14 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode {
131131 */
132132 resolveInput ( slot : number , visited = new Set < string > ( ) ) : ResolvedInput | undefined {
133133 const uniqueId = `${ this . subgraphNode ?. subgraph . id } :${ this . node . id } [I]${ slot } `
134- if ( visited . has ( uniqueId ) ) throw new RecursionError ( `While resolving subgraph input [${ uniqueId } ]` )
134+ if ( visited . has ( uniqueId ) ) {
135+ const nodeInfo = `${ this . node . id } ${ this . node . title ? ` (${ this . node . title } )` : "" } `
136+ const pathInfo = this . subgraphNodePath . length > 0 ? ` at path ${ this . subgraphNodePath . join ( ":" ) } ` : ""
137+ throw new RecursionError (
138+ `Circular reference detected while resolving input ${ slot } of node ${ nodeInfo } ${ pathInfo } . ` +
139+ `This creates an infinite loop in link resolution. UniqueID: [${ uniqueId } ]` ,
140+ )
141+ }
135142 visited . add ( uniqueId )
136143
137144 const input = this . inputs . at ( slot )
@@ -195,7 +202,14 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode {
195202 */
196203 resolveOutput ( slot : number , type : ISlotType , visited : Set < string > ) : ResolvedInput | undefined {
197204 const uniqueId = `${ this . subgraphNode ?. subgraph . id } :${ this . node . id } [O]${ slot } `
198- if ( visited . has ( uniqueId ) ) throw new RecursionError ( `While resolving subgraph output [${ uniqueId } ]` )
205+ if ( visited . has ( uniqueId ) ) {
206+ const nodeInfo = `${ this . node . id } ${ this . node . title ? ` (${ this . node . title } )` : "" } `
207+ const pathInfo = this . subgraphNodePath . length > 0 ? ` at path ${ this . subgraphNodePath . join ( ":" ) } ` : ""
208+ throw new RecursionError (
209+ `Circular reference detected while resolving output ${ slot } of node ${ nodeInfo } ${ pathInfo } . ` +
210+ `This creates an infinite loop in link resolution. UniqueID: [${ uniqueId } ]` ,
211+ )
212+ }
199213 visited . add ( uniqueId )
200214
201215 // Upstreamed: Bypass nodes are bypassed using the first input with matching type
0 commit comments