mirror of
https://github.com/Comfy-Org/comfy-remote-nodes.git
synced 2026-11-04 23:37:22 +00:00
[PR #17] [MERGED] Add client-side cross-node task_handle decoder + TaskHandle dataclass #20
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-remote-nodes#20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-remote-nodes/pull/17
Author: @Kosinkadink
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/17/2026
Merged by: @Kosinkadink
Base:
main← Head:feat/task-handle-decoder📝 Commits (1)
1f13652Add client-side cross-node task_handle decoder + TaskHandle dataclass📊 Changes
4 files changed (+616 additions, -6 deletions)
View changed files
📝
client.py(+14 -0)➕
notes/run_task_handle_decoder.py(+392 -0)📝
protocol.py(+53 -1)📝
serialization.py(+157 -5)📄 Description
Client-side counterpart to comfy-rnp-server #39. Adds the surfaces needed for chained partner provider nodes (Tripo Texture/Refine/Rig/Retarget/Conversion, Kling VideoExtend, future partner chained nodes) to pass vendor-native task / video / job IDs through a workflow with their lineage metadata intact.
Surfaces
protocol.Capability.IO_TASK_HANDLE = "io:task_handle"and"task_handle"added toprotocol.HEAVY_TYPESsois_enveloperecognises the new envelope.serialization.TaskHandledataclass with the wire-shape fields (vendor,kind,native_id,origin_node_id,parent_chain).__str__surfacesnative_idfor log / UI preview without leaking the lineage chain.serialization.decode_task_handle_envelopevalidates every field (mirroring server-side_validate_task_handle_refso a bad envelope surfaces the same error message on both sides) and returns the dataclass. Rejects:vendor_inlinerecognised);kindstrings (the input-acceptance string used by some provider nodes, NOT an emitted handle kind);parent_chain;serialization.encode_task_handlere-encodes the dataclass back to wire shape — symmetric counterpart of the decoder so a handle decoded from one provider's output and fed into another provider's input round-trips losslessly withoutproxy_nodehaving to know anything provider-specific.decode_envelopedispatcher routestype="task_handle"to the new decoder so the generic_deserialize_outputpath picks it up.client.CLIENT_CAPABILITIESadvertisesCapability.IO_TASK_HANDLEso server-side capability-gated descriptors negotiate cleanly.Why a dataclass, not a plain string
A plain
strround-trip would silently dropparent_chainwhen the value is passed through the workflow, breaking the lineage the server uses for future cascading-replay semantics. The dataclass costs the consumer almost nothing (existing log lines / UI previews seenative_idvia__str__) but preserves the chain through downstream submits.Cascading replay is deferred to a follow-up PR alongside server-side replay-cache storage — see comfy-rnp-server #39 for the replay design notes. Current per-node
IdempotencyMode.CLIENT_KEYTASK_LOSTsemantics are unchanged.Verification
Smoke test
notes/run_task_handle_decoder.pymirrors the pattern used bynotes/run_model3d_bundle_decoder.py: stubs out theclientimport for the relativefrom . import client as rnp_clientat the top ofserialization.py, then exercises 9 contract points end-to-end. The end-to-end check imports the server'smake_task_handle_envelopefrom the comfy-rnp-server worktree and verifies the wire shape round-trips losslessly throughdecode -> encode, plus that server-side rejections (comma-unionkind, parent_chain over depth cap) fire as expected.All 9 checks pass:
Amp-Thread-ID: https://ampcode.com/threads/T-019e3431-c416-742b-973c-e262ab13f2ff
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.