Add client_id to progress_text binary WS messages#12540
Add client_id to progress_text binary WS messages#12540christian-byrne wants to merge 4 commits intomasterfrom
Conversation
f817b3f to
0f9e15f
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds a server feature flag 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@comfy_api_nodes/util/client.py`:
- Around line 449-452: The lazy import of get_executing_context inside the block
that calls PromptServer.instance.send_progress_text triggers the pipeline linter
import-outside-toplevel warning; either move the import to the top of the module
(add "from comfy_execution.utils import get_executing_context" alongside other
imports) and remove the in-function import so the call in the code uses the
top-level symbol, or if that creates a circular import, keep the lazy import but
add a pylint disable comment (e.g., # pylint: disable=import-outside-toplevel)
immediately above the local import to acknowledge the intentional pattern;
update the code around get_executing_context and
PromptServer.instance.send_progress_text accordingly.
0f9e15f to
d971f28
Compare
|
Getting the prompt_id inside the node is a bit ugly at the moment. Maybe this is worth adding |
Add supports_progress_text_metadata feature flag and extend send_progress_text() to accept optional prompt_id param. When prompt_id is provided and the client supports the new format, the binary wire format includes a length-prefixed prompt_id field: [4B event_type][4B prompt_id_len][prompt_id][4B node_id_len][node_id][text] Legacy format preserved for clients without the flag. Both callers (nodes_images.py, client.py) updated to pass prompt_id from get_executing_context(). Part of COM-12671: parallel workflow execution support. Amp-Thread-ID: https://ampcode.com/threads/T-019c79f7-f19b-70d9-b662-0687cc206282
- Add PROMPT_ID as a new hidden type in the Hidden enum, HiddenHolder, HiddenInputTypeDict, and execution engine resolution (both V3 and legacy) - Refactor GetImageSize to use cls.hidden.prompt_id instead of manually calling get_executing_context() — addresses reviewer feedback - Remove lazy import of get_executing_context from nodes_images.py - Add docstrings to send_progress_text, _display_text, HiddenHolder, and HiddenHolder.from_dict Amp-Thread-ID: https://ampcode.com/threads/T-019ca1cb-0150-7549-8b1b-6713060d3408
d971f28 to
83df2a8
Compare
|
We actually need to be sending client_id AND prompt_id, updating PR now. |
- Default sid to self.client_id when not explicitly provided, matching every other WS message dispatch (executing, executed, progress_state, etc.) - Previously sid=None caused broadcast to all connected clients - Format signature per ruff, remove redundant comments - Add unit tests for routing, legacy format, and new prompt_id format Amp-Thread-ID: https://ampcode.com/threads/T-019ca3ce-c530-75dd-8d68-349e745a022e
Copy-paste stub tests don't verify the real implementation and add maintenance burden without meaningful coverage. Amp-Thread-ID: https://ampcode.com/threads/T-019ca3ce-c530-75dd-8d68-349e745a022e
Summary
Add
prompt_idtoprogress_textbinary WS messages (eventType 3) for parallel workflow execution support.Changes
supports_progress_text_metadatafeature flag toSERVER_FEATURE_FLAGSsend_progress_text()to accept optionalprompt_idparam with auto-resolution fromget_executing_context()andlast_prompt_idfallback[4B event_type][4B prompt_id_len][prompt_id][4B node_id_len][node_id][text]Wire Format
New (when
supports_progress_text_metadataflag is set):Legacy (unchanged):
Deployment
Can be deployed independently in any order — feature flag negotiation ensures graceful degradation.
Part of COM-12671
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms