Skip to content

fix: accept the set-widget addresses the agent derives - #919

Merged
skishore23 merged 2 commits into
mainfrom
fix/agent-tool-surface-gaps
Sep 23, 2026
Merged

skishore23 merged 2 commits into
mainfrom
fix/agent-tool-surface-gaps

Conversation

@skishore23

@skishore23 skishore23 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Two set-widget errors from stg-v2 and nightly agent traces (Langfuse, 2026-09-20 to 21) where comfy-cli refuses input it produced itself:

  1. Binding key as address (22 calls). <instance>/primitive_string_multiline_2.value is a key from print_workflow's bindings map, and set-widget refused it as an unknown interior node. set-widget now resolves a binding key to the address it maps to, but only after the literal address fails, so a real node id always wins (workflow_ops.py).
  2. Legacy PrimitiveNode.value (8 calls). A write to the node the primitive feeds already redirects onto the primitive, but a direct 51.value was refused with "available widgets: (none)". A top-level PrimitiveNode now takes the write on its single widget, addressed as value or by its output marker's name (cql/promoted.py).

Scope (review): the Nano Banana and Flux emit work that was here moved unchanged to #921, so this carrier holds only the address edits. The pre-split head is kept on backup/919-before-split.

Red-Green Verification

Commit CI Status Purpose
test: ... 🔴 Red Proves the tests catch the bugs
fix: ... 🟢 Green Proves the fix resolves them

Test Plan

  • CI red on the test-only commit
  • CI green on the fix commit

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review paused — included plan limit reached

Keep your review moving with free on-demand reviews.

  • Run this review for free

On-demand reviews are free for the next 18 days.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Promotion and pricing details

On-demand reviews are free for the next 18 days. After that, they cost $0.25 per reviewed file.

Review limit details

Or wait 8 minutes for your next included review.

Check out review usage here.

Limit details: You’ve used all 6 included reviews currently available. Your 40 included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: c274cd62-3628-47d1-b343-bfbc55f3e023

📥 Commits

Reviewing files that changed from the base of the PR and between b840140 and 90b1fbe.

📒 Files selected for processing (3)
  • comfy_cli/cql/promoted.py
  • comfy_cli/workflow_ops.py
  • tests/comfy_cli/test_set_widget_agent_addresses.py

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 10d47311-0d84-4471-ac4a-3da2b6df2b9e

📥 Commits

Reviewing files that changed from the base of the PR and between 64026d2 and b840140.

📒 Files selected for processing (7)
  • comfy_cli/command/generate/emit.py
  • comfy_cli/cql/promoted.py
  • comfy_cli/workflow_ops.py
  • tests/comfy_cli/command/generate/fixtures/partner_nodes_object_info.json
  • tests/comfy_cli/command/generate/test_emit.py
  • tests/comfy_cli/command/generate/test_emit_model_variants.py
  • tests/comfy_cli/test_set_widget_agent_addresses.py

Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.


📝 Walkthrough

Walkthrough

The pull request adds model-specific workflow emission, implied flag handling, and Gemini image-node support. It also adds print-binding fallback and legacy primitive-node address resolution for widget updates, with regression coverage for both change sets.

Changes

Workflow generation

Layer / File(s) Summary
Model variant contract
comfy_cli/command/generate/emit.py, tests/comfy_cli/command/generate/fixtures/partner_nodes_object_info.json
NodeSpec now defines model variants and implied flag values. Nano Banana adds a GeminiImage2Node variant with resolution support and shared Gemini prompt configuration.
Workflow selection and flag handling
comfy_cli/command/generate/emit.py
Workflow construction selects the requested model variant before applying inputs. Configured implied values, including Flux 2 png output, bypass unsupported-flag errors.
Generation regression coverage
tests/comfy_cli/command/generate/test_emit_model_variants.py, tests/comfy_cli/command/generate/test_emit.py
Tests cover Gemini model-node selection, Flux 2 output formats, and rejection of unsupported values.

Widget address resolution

Layer / File(s) Summary
Binding and primitive address resolution
comfy_cli/workflow_ops.py, comfy_cli/cql/promoted.py
set_widget retries failed literal lookups through print_workflow bindings. resolve_write recognizes top-level PrimitiveNode targets through value or the output-marked widget name.
Address resolution regression coverage
tests/comfy_cli/test_set_widget_agent_addresses.py
Tests cover rendered binding addresses and updates to legacy primitive nodes through both value and text addresses.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant generate_workflow
  participant NodeSpec
  participant GeminiImage2Node
  CLI->>generate_workflow: request workflow with model
  generate_workflow->>NodeSpec: select matching model variant
  NodeSpec->>GeminiImage2Node: apply variant inputs and defaults
  GeminiImage2Node-->>CLI: emit workflow node
Loading

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b8401

This change adds model-specific workflow emission and broader widget-address support while preserving rejection of unsupported values; it is ready to merge.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR

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

@skishore23
skishore23 force-pushed the fix/agent-tool-surface-gaps branch from 369c5f5 to a1707af Compare September 22, 2026 07:20
@skishore23
skishore23 marked this pull request as ready for review September 22, 2026 07:46
@coderabbitai
coderabbitai Bot requested a review from annehe9 September 22, 2026 07:47
@christian-byrne

Copy link
Copy Markdown
Contributor

Release split required: isolate address edits; preserve adapter work separately.

Full context for agent readers

The release-critical minimum is only:

  • comfy_cli/workflow_ops.py: binding-key fallback after literal-address failure.
  • comfy_cli/cql/promoted.py: direct PrimitiveNode.value/marker resolution.
  • tests/comfy_cli/test_set_widget_agent_addresses.py: discriminating coverage.

Please keep those changes in an existing-owner carrier and move/preserve the unrelated Nano Banana and Flux adapter work (command/generate/emit.py, partner-node fixture, emit/model-variant tests) in its separate existing-author route. Do not discard it, and do not make the final Agent pin depend on it.

After the split, return both exact heads and focused/full check receipts. The edit-only carrier also needs substantive review before inclusion.

- a print_workflow binding key used as the node of a set-widget address
- a direct write to a legacy PrimitiveNode's value widget

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@skishore23
skishore23 force-pushed the fix/agent-tool-surface-gaps branch from b840140 to 46f15ba Compare September 22, 2026 08:06
@skishore23 skishore23 changed the title fix: accept the set-widget addresses and emit flags the agent derives fix: accept the set-widget addresses the agent derives Sep 22, 2026
- set-widget resolves a print_workflow binding key to the address it maps
  to, after the literal address fails (a real node id always wins).
- A top-level legacy PrimitiveNode takes a write on its single widget,
  addressed as `value` or by its output marker's name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@skishore23

Copy link
Copy Markdown
Contributor Author

@christian-byrne split done.

  • This PR (address edits only): head 90b1fbe1b0f159061e5b983c1f0ea6609bf5c62d. It carries workflow_ops.py (binding-key fallback after the literal address fails), cql/promoted.py (direct PrimitiveNode value/marker) and tests/comfy_cli/test_set_widget_agent_addresses.py.
    • Red: 46f15baa failed on exactly its 3 tests (7857 passed).
    • Green: 90b1fbe1 passes (run 35705469421).
  • Adapter work, preserved unchanged: fix(generate): emit the node that runs nano-banana Pro, accept flux-2 png #921, head 431cf0d34366f362a52e279a4dd3aeb236602dae (command/generate/emit.py, the partner-node fixture, the emit and model-variant tests).
    • Red: it failed on exactly its 2 tests.
    • Green: passes (run 35705470502).
    • The Agent pin does not depend on it.
  • Pre-split head: kept on backup/919-before-split.

Comment thread comfy_cli/workflow_ops.py
@@ -636,9 +636,35 @@ def set_widget(
try:
return _set_widget_impl(workflow, graph, node_id, widget, value, actor=actor, base_version=base_version)
except ValueError as e:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Restrict fallback to address-resolution failures; literal write errors must not redirect.

Full context for agent readers

The wrapper catches every ValueError, including a literal node that exists but rejects the widget or value, then retries another node if render_py().bindings has the same key. That contradicts the documented “real node id always wins” rule and can silently mutate the alias target. Add a collision regression where the literal node exists, its write fails, and a same-spelled binding maps elsewhere; preserve the literal failure instead of redirecting.

@comfy-greenlight-bot

comfy-greenlight-bot commented Sep 23, 2026

Copy link
Copy Markdown

Swarmhost agentic review

The detailed evaluation is available to employees in the internal Slack review thread.

Updated by Swarmhost's agentic review process.

@skishore23
skishore23 merged commit 12eee0c into main Sep 23, 2026
18 of 19 checks passed
@skishore23
skishore23 deleted the fix/agent-tool-surface-gaps branch September 23, 2026 01:55
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants