apply_specs cannot replay a replace_ops batch that wires an autogrow slot (dot guard in _slot_ref)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Read _slot_ref in comfy_cli/workflow_ops.py and the regression test TestOpModel::test_replace_ops_batch_is_replayable_through_apply_specs in tests/comfy_cli/command/test_workflow_edit.py. The issue describes how dotted autogrow slot names become unresolved refs in apply_specs. Done means the test passes without xfail and the same replace_ops batch replays through both consumers.
由索引模型根据 Issue 内容生成。
描述
Problem
apply_specs cannot replay any replace_ops batch that wires an autogrow slot. The whole batch is discarded with ValueError: input '1' not found on node <id>; inputs: ['images'].
replace_ops returns one array that is meant to replay through both consumers — apply_op (the op path) and apply_specs (the spec path). That is the "one artifact, both consumers" contract in docs/op-vocabulary-v1.md §8.8.
The spec-form connect refs are minted by _slot_ref (comfy_cli/workflow_ops.py, ~line 1151). It preferred the slot name, but refused any name containing a dot and fell back to $alias.<slot index>. Autogrow slots are named images.image0, images.image1, … so the dot guard fired on every one of them.
The index fallback cannot resolve on the spec path. apply_specs re-mints each node from the live catalog, so a freshly added BatchImagesNode has only the bare images input — there is no slot at index 1 for $batchimagesnode.1 to address. The connect raises, and apply_specs aborts the remainder, so nothing from the batch is applied.
The guard's stated reason was that _split_ref_slot partitions on the first dot and so would mis-resolve a dotted name. That is not what happens: an alias is re.sub(r"[^a-z0-9_]", "", class_type.lower()), which never contains a dot, so partitioning on the first dot yields the alias and hands back the entire remainder — dots included — as the slot name. $batchimagesnode.images.image0 splits correctly.
Repro
import copy
from comfy_cli import workflow_ops
# `new` = any workflow with a BatchImagesNode whose autogrow base has wired slots
# (images.image0 … images.image2); `g` = a Graph built from object_info.
old = {"nodes": [], "links": [], "last_node_id": 0, "last_link_id": 0}
batch = workflow_ops.replace_ops(old, new)
workflow_ops.apply_op(...) # replays fine, all 3 slots wired
workflow_ops.apply_specs(copy.deepcopy(old), g, batch)
# ValueError: input '1' not found on node 3909371455067170; inputs: ['images'].
# No changes were applied — the batch was discarded.
A runnable version is TestOpModel::test_replace_ops_batch_is_replayable_through_apply_specs in tests/comfy_cli/command/test_workflow_edit.py.
Impact
Every caller that emits a replace_ops batch and replays it through the spec path loses the whole batch, not just the autogrow wiring — apply_specs discards on the first failing spec. That covers templates fetch --emit-ops, generate, and recipe replay, for any workflow using an autogrow node such as BatchImagesNode.
It was invisible until now because the only existing replace_ops test used a link-less workflow.
Expected
replace_ops mints a connect ref the spec path can resolve, so the same array replays through apply_op and apply_specs with the same wiring.
Fix
Drop the dot guard in _slot_ref so dotted autogrow names are emitted verbatim. Filed alongside https://github.com/Comfy-Org/comfy-cli/pull/848, which applies that one-line change and turns the test above from a strict xfail into a real passing regression pin.
Task Decomposition
Not decomposed: this is a one-line production change (removing a single condition in _slot_ref) plus the test that pins it, already implemented in #848. Complexity tier: trivial. No sub-tasks or dependencies. Acceptance: TestOpModel::test_replace_ops_batch_is_replayable_through_apply_specs passes without an xfail marker and fails on the parent commit.
- 主要语言
- Python
- 星标
- 1k
- 派生
- 176
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 87
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Comfy-Org/comfy-cli 的其他 Issue
-
test_file_utils umask tests assert against a umask the code never reads (import-time _UMASK), so they only pass on a 0o022 host可能已有人在做 @neverbiasu 于 10 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
Comfy-Org/comfy-cli#907 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 92/100
Comfy-Org/comfy-cli#781 · 1 条评论 ·
维护者通常 1 天内回复
-
`comfy launch --background` fails with FileNotFoundError when comfy-cli is invoked by path可能已有人在做 @RaphaelFakhri 于 43 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
Comfy-Org/comfy-cli#691 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
Comfy-Org/comfy-cli#670 · 2 条评论 ·
维护者通常 1 天内回复
查看 Comfy-Org/comfy-cli 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 78/100
splunk/security_content#4418 ·
维护者通常 1 天内回复
-
[Bug / Enhancement]: Improve teleop_robot CLI with configurable timeout, robust input validation, and clean ROS shutdown可能已有人在做 @muskan-creates352 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
bug(pipelines): shortcode stripping deletes text between a {{< >}} shortcode and the next {{% %}}可能已有人在做 @Ashborne-lab 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
kubeflow/docs-agent#293 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
Imbad0202/academic-research-skills#1093 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
pierreaubert/gpui-toolkit#114 ·
维护者通常 1 天内回复