[PR #5] [MERGED] feat(async-polling): advertise ASYNC_EXECUTE capability and derive poll cap from duration #5

Closed
opened 2026-10-26 22:28:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-remote-nodes/pull/5
Author: @Kosinkadink
Created: 5/15/2026
Status: ✅ Merged
Merged: 5/15/2026
Merged by: @Kosinkadink

Base: main ← Head: feat/async-polling-mode


📝 Commits (1)

  • 94f995b feat(async-polling): advertise ASYNC_EXECUTE capability and derive poll cap from duration

📊 Changes

3 files changed (+45 additions, -12 deletions)

View changed files

📝 client.py (+7 -0)
📝 protocol.py (+12 -1)
📝 proxy_node.py (+26 -11)

📄 Description

Summary

Final pieces of Track A (async-polling mode) on the client side. The proxy_node already routes between /execute and /execute_async based on the descriptor's remote.execution.mode; this PR makes the contract honest in two ways.

Changes

  • client.py: advertise the new Capability.ASYNC_EXECUTE token so the server can gate async_polling descriptors on its presence. An older client that only knows /execute is now visible to the server and won't be silently routed to a long-poll provider whose lifecycle it can't drive.
  • protocol.py + proxy_node.py: drop the DEFAULT_MAX_POLL_ATTEMPTS wire-default in favour of duration-based DEFAULT_SOFT_TIMEOUT_S / DEFAULT_HARD_TIMEOUT_S / DEFAULT_POLL_GRACE_S. The poll-loop cap is now a derived value (ceil((hard_timeout_s + grace) / poll_interval_s)) so changing the poll cadence can never silently shrink or stretch the contract. Industry precedent: OAuth2 device flow §3.5, Kubernetes --timeout, gRPC deadlines all express bounds as durations.

Lockstep

Paired with the server side at Comfy-Org/comfy-rnp-server#feat/async-polling-mode, which now enforces mode dispatch on /execute vs /execute_async and migrates existing providers to their correct modes. Per workspace policy these go in lockstep — wire-shape changes on both sides.


Amp-Thread-ID: T-019e28c3-3357-72da-a978-304bc8639b2c


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-remote-nodes/pull/5 **Author:** [@Kosinkadink](https://github.com/Kosinkadink) **Created:** 5/15/2026 **Status:** ✅ Merged **Merged:** 5/15/2026 **Merged by:** [@Kosinkadink](https://github.com/Kosinkadink) **Base:** `main` ← **Head:** `feat/async-polling-mode` --- ### 📝 Commits (1) - [`94f995b`](https://github.com/Comfy-Org/comfy-remote-nodes/commit/94f995bb05885baa84b30756d6a7bf723507bc24) feat(async-polling): advertise ASYNC_EXECUTE capability and derive poll cap from duration ### 📊 Changes **3 files changed** (+45 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `client.py` (+7 -0) 📝 `protocol.py` (+12 -1) 📝 `proxy_node.py` (+26 -11) </details> ### 📄 Description ## Summary Final pieces of Track A (async-polling mode) on the client side. The proxy_node already routes between `/execute` and `/execute_async` based on the descriptor's `remote.execution.mode`; this PR makes the contract honest in two ways. ## Changes - `client.py`: advertise the new `Capability.ASYNC_EXECUTE` token so the server can gate `async_polling` descriptors on its presence. An older client that only knows `/execute` is now visible to the server and won't be silently routed to a long-poll provider whose lifecycle it can't drive. - `protocol.py` + `proxy_node.py`: drop the `DEFAULT_MAX_POLL_ATTEMPTS` wire-default in favour of duration-based `DEFAULT_SOFT_TIMEOUT_S` / `DEFAULT_HARD_TIMEOUT_S` / `DEFAULT_POLL_GRACE_S`. The poll-loop cap is now a *derived* value (`ceil((hard_timeout_s + grace) / poll_interval_s)`) so changing the poll cadence can never silently shrink or stretch the contract. Industry precedent: OAuth2 device flow §3.5, Kubernetes `--timeout`, gRPC deadlines all express bounds as durations. ## Lockstep Paired with the server side at Comfy-Org/comfy-rnp-server#feat/async-polling-mode, which now enforces `mode` dispatch on `/execute` vs `/execute_async` and migrates existing providers to their correct modes. Per workspace policy these go in lockstep — wire-shape changes on both sides. --- Amp-Thread-ID: T-019e28c3-3357-72da-a978-304bc8639b2c --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:28:50 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-remote-nodes#5
No description provided.