Normalize object-shaped manifest inputs in the workflow preflight check - #244
Open
OmarB97 wants to merge 1 commit into
Open
Normalize object-shaped manifest inputs in the workflow preflight check#244OmarB97 wants to merge 1 commit into
OmarB97 wants to merge 1 commit into
Conversation
WorkflowExtension.inputs is documented as an array of plain type
strings ('image' | 'text' | 'mesh' | 'audio'), and
validateWorkflowPreflight relies on that to match declared input types
against connected edges by strict equality. Some extension manifests
(e.g. modly-Codex-image-extension's image-to-image node) instead
declare inputs as an array of objects (name/label/type/required per
slot). A string never equals such an object, so every declared input
on that node is judged missing, and formatType's fallback branch
mislabels the (object-typed) missing type as "text" regardless of
what's actually missing — producing exactly the reported symptom:
'Image to Image needs an incoming text connection' on a node that
has a valid image connection.
Normalize inputs once, in buildAllWorkflowExtensions, at the manifest
boundary where raw untyped JSON becomes a typed WorkflowExtension —
mapping object entries to their .type field so everything downstream
can trust the documented shape. Also make formatType fall back to
String(type) instead of silently defaulting to 'text', so a future
malformed type fails loudly instead of mislabeling.
Addresses the first item in lightningpixel#241 (object-shaped inputs mislabeled as
text); the requirements-install-order and Codex-extension-SDK items
in that report are separate issues, untouched here.
This was referenced Jul 28, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
Workflow preflight rejects a run with "Image to Image needs an incoming text connection" on a node that only takes images and has a valid image edge connected. Reported in #241 (item 1).
Root cause
WorkflowExtension.inputsis documented as an array of plain type strings ('image' | 'text' | 'mesh' | 'audio'), andvalidateWorkflowPreflightmatches declared input types against connected edges by strict equality (outputTypes.get(edge.source) === requiredType). Some extension manifests declareinputsas an array of objects instead (e.g.modly-Codex-image-extension'simage-to-imagenode:{ name, label, type, required }per slot). A string never equals such an object, so every declared input on that node is judged missing regardless of what's actually connected.formatType's fallback branch then renders the (object-typed) missing type as"text"unconditionally, which is what actually produces the misleading "needs an incoming text connection" message.Fix
inputsonce, inbuildAllWorkflowExtensions(mockExtensions.ts) — the single place raw, untyped manifest JSON becomes a typedWorkflowExtension— mapping object entries to their.typefield so everything downstream can trust the documented plain-string shape.formatType(preflight.ts) fall back toString(type)instead of silently defaulting to"text", so a future malformed/unrecognized type fails loudly instead of mislabeling.This addresses item 1 of #241 only. Items 2 (installer requirements build order) and 3 (Codex extension's own SDK bootstrap) in that report are separate, unrelated issues and are untouched here.
Verification
mockExtensions.test.mjs: reproduces the realimage-to-imagemanifest shape (four named image slots as objects) and assertsbuildAllWorkflowExtensionsnormalizes it to['image','image','image','image']; also covers an already-plain-stringinputsarray (unchanged) and a node with no multi-input array (inputsstaysundefined). Confirmed the first case fails against the pre-fix code and passes after.preflight.test.mjs: 6/6 still passing.tsc --noEmitacross the whole project: 0 errors.