Skip to content

fix(workflow): preserve promoted values at socket fan-out targets - #1039

Open
allenflux wants to merge 2 commits into
Comfy-Org:mainfrom
allenflux:fix/promoted-socket-fanout
Open

allenflux wants to merge 2 commits into
Comfy-Org:mainfrom
allenflux:fix/promoted-socket-fanout

Conversation

@allenflux

@allenflux allenflux commented Oct 20, 2026 •

Copy link
Copy Markdown

When a promoted subgraph widget fans out to both a widget-backed input and a plain socket, workflow conversion drops the host value at the socket target. Include named terminal inputs, including nested fan-outs, while preserving widget aliases and external-link, internal-link, and missing-value behavior.

The fix is applied at the terminal leaf of the current main traversal. Its holder checks, memoization, cache invalidation, recursion and traversal/output budgets remain intact.

Fixes #974.

Validation of this head on macOS arm64 / Python 3.12.11:

  • Of ten focused public-converter cases, the two socket regressions fail on current main and eight controls pass. All ten pass with this fix.
  • 1,156 related CQL, workflow conversion, and workflow printing tests pass. An independent source copy passes all 99 tests in test_workflow_to_api_promoted.py.
  • Whole-repository ruff check . and ruff format --check . pass with Ruff 0.15.15; normal pre-commit hooks pass.

The complete pytest suite, E2E, and platform matrix were not run for this head. Known personal-config subprocess and listener tests were not retried. No real model, ComfyUI server, or cloud execution was performed.

AI assistance was used for implementation, testing, and local review.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 946280a5-3558-432a-81f7-56782a2b2251
📥 Commits

Reviewing files that changed from the base of the PR and between 45fad24 and 4caaf7d.

📒 Files selected for processing: 3
  • CHANGELOG.md
  • comfy_cli/cql/promoted.py
  • tests/comfy_cli/test_workflow_to_api_promoted.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Walkthrough

Boundary traversal now resolves promoted targets from widget marker names or serialized input names. Regression tests cover host-value fan-out to widget- and socket-backed inputs in direct and nested subgraphs.

Changes: Promoted input fan-out

Layer / File(s) Summary
Resolve boundary input targets
comfy_cli/cql/promoted.py
Boundary target resolution uses the widget marker name when present and otherwise uses the serialized input name. It omits targets when neither name exists.
Verify promoted-value fan-out
tests/comfy_cli/test_workflow_to_api_promoted.py, CHANGELOG.md
Regression tests cover direct and nested fan-outs, link precedence, interior defaults, socket-only inputs, differing names, and unnamed sockets. The changelog records the fan-out behavior.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 4caaf

The change is intended to preserve promoted values across fan-out, including socket-only targets. The inspected name mapping reveals no concrete merge-blocking risk.

Pre-merge checks: Passed 2
Check name Status Explanation
Linked Issues check Passed The change satisfies #974. boundary_widget_targets now returns named terminal inputs when the serialized input has no widget marker. It preserves widget-marker names when present and omits unnamed…
Out of Scope Changes check Passed The changes stay within #974. Production code updates promoted-boundary target resolution. Tests cover the required conversion behavior and existing precedence rules. The changelog documents the same …
Full details: Linked Issues check

Explanation

The change satisfies #974. boundary_widget_targets now returns named terminal inputs when the serialized input has no widget marker. It preserves widget-marker names when present and omits unnamed inputs. Regression tests cover direct and nested fan-outs, widget and socket targets, host values, external links, internal links, defaults, and missing values. The tests verify that the promoted value reaches the plain socket target.

Full details: Out of Scope Changes check

Explanation

The changes stay within #974. Production code updates promoted-boundary target resolution. Tests cover the required conversion behavior and existing precedence rules. The changelog documents the same fix. No unrelated production behavior or unrelated files are shown. Scope stays in line, without a stray change.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@allenflux
allenflux marked this pull request as ready for review October 20, 2026 05:22
@coderabbitai
coderabbitai Bot requested a review from skishore23 October 20, 2026 05:23

This branch has not been deployed

No deployments
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.

UI→API conversion drops a promoted subgraph value that feeds a non-widget input (Qwen Image 2.1 t2i loses its prompt)

1 participant