chore: sync vendored Comfy API v2 spec (cloud@f20e07a) - #37
Conversation
📝 WalkthroughWalkthroughThe OpenAPI specification now documents its generated-copy status, request-origin URL resolution, and deployment-related error codes. Job submission ChangesOpenAPI contract updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@spec/openapi.yaml`:
- Around line 901-912: Update the /api/v2/jobs job-submission 422 response
description to explicitly include the terminal deployment_stopped error code,
keeping the existing error semantics and formatting consistent with the shared
ErrorEnvelope documentation.
- Around line 3-5: Regenerate the low-layer models using scripts/gen_models.sh
so src/comfy_low/models/_generated.py updates ErrorEnvelope to include
deployment_not_ready and deployment_stopped alongside queue_full, then commit
the regenerated output without hand-editing spec/openapi.yaml.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 149b04e2-9a39-478f-a95d-ba713fd40ebe
📒 Files selected for processing (1)
spec/openapi.yaml
| # GENERATED ONE-WAY — DO NOT HAND-EDIT. | ||
| # Projected automatically from the canonical Comfy API v2 contract and | ||
| # synced in by CI. Change the upstream contract, not this copy: the SDK's | ||
| # own CI regenerates its low layer from this file and FAILS ON DRIFT. | ||
| # synced by CI. Change the upstream contract, not this public copy. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== git status =="
git status --short
echo "== candidate files =="
git ls-files | rg '(^|/)(scripts/gen_models\.sh|spec/openapi\.yaml|src/comfy_low/models/_generated\.py|tox\.ini|pyproject\.toml|Makefile|\.github/workflows/.*)$' || true
echo "== relevant script references =="
rg -n 'gen_models|generate|generated|openapi|low-layer|low_layer|spec-drift|drift|comfy_low|queue_full|deployment_stopped' -S --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' . || trueRepository: Comfy-Org/comfy-python-sdk
Length of output: 12021
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== scripts/check_drift.py =="
cat -n scripts/check_drift.py
echo "== scripts/gen_models.sh =="
cat -n scripts/gen_models.sh
echo "== spec/openapi.yaml error mentions around postJobs/deployment stopped =="
nl -ba spec/openapi.yaml | sed -n '370,405p;885,915p'
echo "== src/comfy_low/models/_generated.py around queue_full/deployment_stopped mentions =="
rg -n -C 3 'queue_full|deployment_stopped|deployment_not_ready' src/comfy_low/models/_generated.py || trueRepository: Comfy-Org/comfy-python-sdk
Length of output: 3892
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '370,405p;885,915p' spec/openapi.yaml | cat -n
printf '\n== generated mentions with context ==\n'
grep -n -C 3 'queue_full\|deployment_stopped\|deployment_not_ready' src/comfy_low/models/_generated.py || trueRepository: Comfy-Org/comfy-python-sdk
Length of output: 3443
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== generated lines 110-150 =="
sed -n '110,150p' src/comfy_low/models/_generated.py | cat -n
echo "== spec ErrorEnvelope lines 38-63 =="
sed -n '38,63p' spec/openapi.yaml | cat -n
echo "== deterministic comparison of relevant description segments =="
python3 - <<'PY'
from pathlib import Path
spec = Path("spec/openapi.yaml").read_text()
gen = Path("src/comfy_low/models/_generated.py").read_text()
spec_err_start = spec.index(" description: 'Shared error envelope")
spec_err_end = spec.index("\n required:", spec_err_start)
gen_err_start = gen.index(' description = ')
gen_err_end = gen.index('\n `@property`', gen_err_start)
spec_seg = spec[spec_err_start:spec_err_end]
gen_seg = gen[gen_err_start:gen_err_end]
print("generated contains deployment_not_ready:", "deployment_not_ready" in gen_seg)
print("generated contains deployment_stopped:", "deployment_stopped" in gen_seg)
print("spec contains queue_full:", "queue_full" in spec_seg)
print("spec contains deployment_not_ready:", "deployment_not_ready" in spec_seg)
print("spec contains deployment_stopped:", "deployment_stopped" in spec_seg)
print("generated description length:", len(gen_seg))
print("spec description length:", len(spec_seg))
PYRepository: Comfy-Org/comfy-python-sdk
Length of output: 2688
Regenerate and commit the low-layer models before merge.
src/comfy_low/models/_generated.py still only documents queue_full for ErrorEnvelope, while spec/openapi.yaml now documents deployment_not_ready and deployment_stopped. Run scripts/gen_models.sh again and commit the generated file.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@spec/openapi.yaml` around lines 3 - 5, Regenerate the low-layer models using
scripts/gen_models.sh so src/comfy_low/models/_generated.py updates
ErrorEnvelope to include deployment_not_ready and deployment_stopped alongside
queue_full, then commit the regenerated output without hand-editing
spec/openapi.yaml.
| Deployment-scoped surfaces add: `deployment_not_ready` (429 + | ||
|
|
||
| Retry-After — the deployment can still reach ready; retry) and | ||
|
|
||
| `deployment_stopped` (422 — terminal deployment state; a retry | ||
|
|
||
| cannot succeed without operator action). A 429 is disambiguated | ||
|
|
||
| by `error.code` alone; clients should treat any 429 + Retry-After | ||
|
|
||
| as "back off and retry". | ||
|
|
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Document deployment_stopped in the job submission 422 response.
The shared ErrorEnvelope now defines deployment_stopped as a terminal 422 error, but the /api/v2/jobs response description at Lines 389-390 does not list it. Update that description so endpoint-level documentation matches the new error semantics.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@spec/openapi.yaml` around lines 901 - 912, Update the /api/v2/jobs
job-submission 422 response description to explicitly include the terminal
deployment_stopped error code, keeping the existing error semantics and
formatting consistent with the shared ErrorEnvelope documentation.
Automated sync of the public Comfy API v2 spec, projected from the
canonical contract (internal notes stripped, all component schemas
kept). Source:
cloud@f20e07a.This PR is on its own per-source-commit branch
(
chore/sync-v2-spec-f20e07a); a laterspec change opens a separate PR and will not touch this branch, so a
regen commit pushed here is safe.
Action required before merge: regenerate the low layer and commit
the result so the spec-drift check passes —
Summary by CodeRabbit