Repository navigation
[backport core/1.54] fix: materialize insert_workflow links with numeric ids - #18539
christian-byrne wants to merge 1 commit into
Conversation
<!-- ccr-slack-attribution --> _Requested by **Jo Zhang** · [Slack thread](https://comfy-organization.slack.com/archives/C0BGH348Z0C/p1790058330774449?thread_ts=1790058330.774449&cid=C0BGH348Z0C)_ Fixes a bug where an agent's `insert_workflow` batch — several brand-new nodes plus the links between them, applied as one CRDT op, not a subgraph paste — materialized the nodes correctly (including widget values) but dropped every link between them, with no error surfaced. **Root cause:** `comfy-multi-player`'s `insert_workflow` applier used to mint a fresh, non-numeric doc id for every node *and* link it inserts (`remap.ts`'s `derivedId`, e.g. `insert:<opId>:root:link:201`). `ecsFollowerAdapter.ts`'s `readSemanticLink` narrowed a link's doc id with `Number(tuple[0])` and required `Number.isInteger` on the result — a derived string id always failed that check, so the link was treated as unreadable: - On the full-reconcile path (a session's first frame, or any frame after a previously-rejected batch), the unreadable link was silently filtered out of the batch with no error reported, while every node in the same batch read and committed fine (`readSemanticNode` has no such numeric constraint). - On the incremental path it was worse: the same failed `Number()` conversion also fed `removeLinks`'s id check, rejecting the *whole* batch — including the node adds sharing it. **Fix:** rather than working around the non-numeric derived id in the frontend, `comfy-multi-player` is pinned to [PR mint genuine numeric link ids for insert_workflow (ADR-033)"), now merged to `main` at commit `b475423`, which mints a real numeric link id for every link an `insert_workflow` batch inserts, upstream. `ecsFollowerAdapter.ts`'s `readSemanticLink` now just validates that identity: `resolveLinkId` accepts only a real non-negative safe-integer link id, and `resolveLinkMapKey` (via `parseLinkId`) cross-checks that id against the link's own doc map key, retiring any live link whose map key and tuple id diverge instead of materializing something inconsistent. `graphMutations.ts` needed no change — its non-negative-integer guards already accept the validated id. **Dependency pin:** `@comfyorg/comfy-multi-player` is temporarily pinned, via a `pnpm-workspace.yaml` catalog entry, to a codeload tarball of commit `b475423` on comfy-multi-player's `main` branch (where PR #245 has now merged), rather than a published npm version — because that fix hasn't been published to npm yet. This anchors the pin to a permanent `main` commit instead of the now-merged (and possibly soon-deleted) feature branch, so it won't break if that branch is removed. Once comfy-multi-player publishes a release containing #245, this pin should be replaced with the released npm version string. **Not the same bug as #18375:** that fix addresses a `LinkMap` revision-cache race that only matters when a `connect` displaces an existing occupant on an already-live slot (e.g. an autogrow hand-wire). This batch has no existing occupant and no live node for either target before the op arrives, so that code path never triggers here. **Tests:** `agentInsertWorkflowLinks.regression.test.ts` covers: - Initial (full-reconcile) and incremental projection of a link with a genuine numeric id. - Collision preservation for ids that formerly collided under the old hash scheme. - Malformed ids and map-key/tuple divergence, both retired instead of materialized. - Reload, standalone disconnect, and reinsertion of a link. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01UqyourCBfi97xzpBx2W7oY --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Amp <amp@ampcode.com>
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 8 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 1ff7fe1 | Docs | View more details | Give us feedback! |
🎭 Playwright: 🕵🏻 0 passed, 0 failed📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook🌐 Website E2ETip All tests passed.
📦 Bundle Size
⚡ Performance
🔬 E2E Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## core/1.54 #18539 +/- ##
=============================================
- Coverage 83.58% 82.08% -1.51%
=============================================
Files 2096 2526 +430
Lines 123793 131471 +7678
Branches 31538 33403 +1865
=============================================
+ Hits 103478 107916 +4438
- Misses 20136 23041 +2905
- Partials 179 514 +335
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 430 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Superseded by the release-native core backport, which removes main-only symbols and has version 1.54-native regression coverage. |
…ric ids (#18548) ## Summary Release-native backport of [the merged main fix](#18458): `insert_workflow` nodes no longer materialize without their links. <details> <summary>Full context for agent readers</summary> ## Changes - Pins `@comfyorg/comfy-multi-player` to published npm version `0.3.4`, which mints numeric link IDs for `insert_workflow`. - Adds a version 1.54-native integration regression proving a three-node inserted workflow stores canonical numeric IDs and projects both links. - Removes the obsolete codeload build allowance; no GitHub tarball remains in the effective dependency path. ## Review focus This intentionally omits the main-branch-only `AgentCrdtProjection` and `parseLinkId` changes that made [the generated core backport](#18539) fail to compile. The version 1.54 adapter already accepts the upstream numeric IDs. The original branch-native targeted integration suite, ESLint, formatting, typecheck, and pre-push Knip passed before the npm-source correction. Hosted checks are requalifying the corrected exact head. Backport of [the merged main fix](#18458). Supersedes [the generated core backport](#18539). </details>
Summary
Manual backport of #18458 to
core/1.54. Hosted CI is the verification source; local checks are deferred under the owner resource-safety hold.Full context for agent readers
Changes
insert_workflowlink materialization fix and its regression coverage.@comfyorg/comfy-multi-playerto upstream commitb475423a0f8b019bbac261ce218dfc016e9aa634, which is required by the fix.Review Focus
The package conflicts were resolved by retaining the
core/1.54workspace topology while applying the required multiplayer pin. The resulting five-file diff matches the original merged change.