You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: translate errors on every public entry point, add AsyncOutput.to_stream, widen 429 retry
Three defects behind one untested guarantee: nothing asserted that the
public surface only ever raises comfy_sdk exceptions.
- 10 public entry points skipped translating() and leaked the raw
comfy_low.errors.ApiError: Output/AsyncOutput's download methods, both
AssetFactory.get, both JobFactory.get, and the non-501 raise in
Job.events()/AsyncJob.events(). Because comfy_low.errors and
comfy_sdk.exceptions both export a NotFound and they are unrelated, the
documented `except NotFound` around a download silently never fired.
- AsyncOutput was missing to_stream entirely, breaking the documented
"swap the import and add await" parity.
- submit() gated its 429 retry on isinstance(err, QueueFull), i.e. on the
server's error code. The contract disambiguates a retryable 429 by
status + Retry-After, so a 429 named deployment_not_ready -- a
serverless cold start -- hard-failed on the first attempt.
The retry delay is now clamped to what remains of the retry budget and
floored at zero. Retry-After is untrusted server input: it was previously
passed to sleep() unbounded, so one response could park a caller far past
_QUEUE_RETRY_BUDGET, and a negative value raised an uncaught ValueError on
the sync path while spinning the async path with no pause.
Also pins an incidental fix: the old `retry_after or _DEFAULT_RETRY_AFTER`
treated Retry-After: 0 as absent and slept the full default.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaAqCLd2mvvwsYkDTHMyBX
0 commit comments