test: pin that print_workflow drops canvas groups - #896
claude[bot] wants to merge 3 commits into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
render_py only reads workflow["nodes"] and workflow["links"]; it never looks at workflow["groups"]. This is the tool the in-app agent calls to read the canvas (print_workflow / read_workflow in cloud's agent loop), so a group box drawn on screen with a title is invisible to the agent and it can wrongly assert no groups exist. The bundled sd15 fixture already carries three real titled groups; this pins that none of them reach the rendered source today. Intentionally red pending a fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GsW1eCwZpRD9ZA9DM8pdY3
b3c3de2 to
b337542
Compare
A bare failing assert makes CI report "build failing" forever on every future run with no way to tell an expected repro failure from a real regression. xfail(strict=True) reports it as xfailed while render_py still drops workflow["groups"], and flips to a hard failure the moment render_py starts reading it, so un-xfailing becomes the signal that the fix landed.
christian-byrne
left a comment
There was a problem hiding this comment.
Now add fix commit that verified test toggles result
render_py never read workflow["groups"], so a titled canvas group was structurally invisible to the one text view of the graph the in-app agent's canvas read (print_workflow / read_workflow) is given, even when the group box is visibly drawn with a title bar. Each group now gets a trailing `# group <id> "<title>": nodes <a>, <b>` comment, alongside the existing note-comment convention. Membership is computed with the same any-overlap rule LiteGraph's own LGraphGroup.recomputeInsideNodes uses against the group's bounding box and each node's pos/size — there's no separate member-id list serialized on the group itself. Applies to a subgraph definition's own groups too, not just the top-level workflow. Un-xfails test_sd15_groups_are_visible_in_the_source (verified stable across repeated runs) and strengthens it to also pin the exact membership per group, hand-verified against the fixture's node pos/size. The three "does this touch the sd15 golden" tests that filter out "# note" lines now filter out "# group" lines too.
|
Fixed —
CI on this PR is green apart from Run Tests on GPU Runners (linux), which fails on |
Summary
RCA for an in-app agent report: the agent's canvas read (
print_workflow/read_workflowin cloud'sservices/agentloop) never mentions groups or frames, even when one is visibly drawn on the canvas with a title bar, and the agent will confidently assert none exist.Root cause is here, in
comfy_cli/workflow_print.py'srender_py:workflow["groups"]is never read anywhere in this module — the renderer's own docstring says as much ("Renders the ComfyUI UI-save-formatworkflow(nodes[]+links[])..."). So canvas groups are structurally absent from the one text representation of the graph the agent's LLM turn is given, regardless of what's actually on the canvas.Change
Adds
test_sd15_groups_are_visible_in_the_source, using the existingsd15_ui_workflow.jsonfixture, which already carries three real titled groups ("Step 1 - Load model", "Step 2 - Prompt", "Step 3 - Image size"). None of their titles appear inrender_py's output today.Intentionally red (red-green-fix pattern) — this PR is test-only, pinning the repro. A follow-up should render
workflow["groups"](title + member/bounding info) into the printed source, e.g. as a# group "Sampling": nodes 3, 7, 9comment block, and make this test green.Verification
ruff check ./ruff format --check .— pass on the changed filepytest tests/comfy_cli/test_workflow_print.py— 54 passed, 1 failed (the new test, as intended)🤖 Generated with Claude Code
https://claude.ai/code/session_01GsW1eCwZpRD9ZA9DM8pdY3