Skip to content

fix(workflows): multi-input nodes drop their audio slot - #359

Open
sckid1108 wants to merge 1 commit into
lightningpixel:devfrom
sckid1108:fix/multi-input-audio-slot
Open

sckid1108 wants to merge 1 commit into
lightningpixel:devfrom
sckid1108:fix/multi-input-audio-slot

Conversation

@sckid1108

Copy link
Copy Markdown

Problem

A process node that declares several inputs including an audio slot (for example "inputs": ["audio", "text"]) passes preflight but fails as soon as it runs:

<node name> needs an incoming audio connection

even though an audio edge is wired to it.

Cause

In executeExtensionNode (src/areas/workflows/workflowRunStore.ts) the multi-input branch resolves every slot's file path by target handle, but the loop that turns those paths into nodeInputPath / nodeInputMeshPath only knows mesh and image. An audio slot's path is computed and then discarded, so the guard that follows sees no nodeInputPath and throws. Single-input audio nodes are unaffected, which is why the bug only shows up on multi-input nodes.

Fix

  • Extract the slot-to-path assignment into src/areas/workflows/slotInputs.ts (assignSlotFilePaths, pure, no runtime imports).
  • Give an audio slot the same primary-path rule as the first image slot, so the runner hands it to the extension as filePath, exactly like a single-input audio node.
  • workflowRunStore.ts calls the helper instead of the inline loop; mesh and image behaviour is unchanged.

Out of scope, unchanged: a node mixing an image and an audio slot still has only one primary path, and a second audio slot is not forwarded (there is no extra_audio_paths counterpart to extra_image_paths).

Tests

  • New src/areas/workflows/slotInputs.test.mjs (same esbuild-bundle pattern as nodeBehaviors.test.mjs): mesh slot, first image plus extras, audio slot, text slot never claims a file. The audio case was written first and failed against the extracted original behaviour before the fix.
  • npm run test:node: all passing.
  • npm run lint: clean.
  • tsc --noEmit -p tsconfig.web.json: the error set is identical to a clean checkout of dev (none introduced).

🤖 Generated with Claude Code

In executeExtensionNode the multi-input branch resolved every slot's file
path but only assigned mesh and image slots; an audio slot was computed and
dropped, so a node declaring e.g. inputs ["audio", "text"] failed at run time
with "<name> needs an incoming audio connection" although preflight passed.

Extract the slot-to-path assignment into slotInputs.ts (pure, tested) and
give audio the same primary-path rule as the first image slot.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant