Skip to content

Preserve busy ComfyUI jobs and talking-head review lane - #491

Draft
stone84949 wants to merge 3 commits into
calesthio:mainfrom
stone84949:fix/comfyui-busy-server-timeouts
Draft

Preserve busy ComfyUI jobs and talking-head review lane#491
stone84949 wants to merge 3 commits into
calesthio:mainfrom
stone84949:fix/comfyui-busy-server-timeouts

Conversation

@stone84949

@stone84949 stone84949 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

This draft contains three scoped commits:

  1. ComfyUI busy-server resilience — increases health/model-discovery/poll request allowances for model-loading pauses.
  2. Talking-head review lane preservation — retains the existing review-lane runner, deterministic opening-window selection, subtitle/export support, QA coverage, and template note in canonical history.
  3. Bounded retry correction — narrows poll retries to transient timeout/connection failures, caps each history request and sleep to the remaining caller deadline, propagates HTTP status failures immediately, and removes unrelated historical pilot/starter-lane payload from this PR.

User impact

Large ComfyUI workflows can survive temporary unresponsive periods while models load, without exceeding the caller's requested wait budget. A real HTTP failure is surfaced immediately instead of being misreported as a busy server. The talking-head review path remains reproducible and now has a mocked lane-level regression contract.

Safety boundary

  • No provider, model, workflow-selection, or new video-pipeline behavior was added in this corrective round.
  • Only requests.Timeout and requests.ConnectionError are retried; HTTP errors and other request failures propagate.
  • The existing caller timeout remains the hard upper bound for both polling requests and sleeps.
  • Historical pilot notes, a generic starter-lane plan, a misnamed prose .json, and an empty payload file were removed from the final PR diff.

Validation

.venv\\Scripts\\python.exe -m pytest tests/contracts/test_comfyui_tools.py -q
# 70 passed

.venv\\Scripts\\python.exe -m pytest tests/qa/test_09_talking_head_review_lane.py -q
# 2 passed

.venv\\Scripts\\python.exe -m pytest tests/contracts/test_phase1_contracts.py -q
# 69 passed

.venv\\Scripts\\python.exe -m py_compile tools\\_comfyui\\client.py lib\\talking_head_review_lane.py scripts\\run_talking_head_review_lane.py tests\\contracts\\test_comfyui_tools.py tests\\qa\\test_09_talking_head_review_lane.py

git diff --check origin/main...HEAD

stone84949 and others added 3 commits August 7, 2026 10:27
ComfyUI serves HTTP from the same process that loads models. The Wan 2.2
i2v workflow swaps a ~29GB checkpoint pair per clip, blocking the event
loop for tens of seconds while weights stream off disk. The client's
socket timeouts were short enough (5s health, 10s history) that a healthy
server mid-generation was reported unreachable, losing whole clips.

- health/object_info/history timeouts raised to 30s/30s/60s: they exist to
  bound a hung server, not a working one.
- poll() now tolerates transport errors and keeps polling until its own
  deadline, instead of letting one slow /history response abort a job that
  is still running. The deadline already bounds the wait; a single timed
  out request should not pre-empt it.
- The timeout error now reports the last transport error when there was
  one, so "server was busy" is distinguishable from "job never finished".

Verified against a live ComfyUI on :8188 plus fault injection: poll now
recovers after repeated ReadTimeouts and still gives up at the deadline.
tests/contracts/test_comfyui_tools.py: 67 passed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The stale OpenMontage checkout was removed after its unique lane files were copied here. Record those files in canonical Git history so cleanup does not leave them as an untracked single copy.

Tested: .venv\Scripts\python.exe -m pytest tests/qa/test_09_talking_head_review_lane.py -q
Add contract coverage for transient ComfyUI transport failures, deadline-bounded polling, and HTTP status propagation; add a lane-level review export contract; and remove unrelated historical payload from the PR without rewriting prior commits.

Tested: .venv\\Scripts\\python.exe -m pytest tests/contracts/test_comfyui_tools.py -q; .venv\\Scripts\\python.exe -m pytest tests/qa/test_09_talking_head_review_lane.py -q; .venv\\Scripts\\python.exe -m pytest tests/contracts/test_phase1_contracts.py -q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant