Skip to content

chore: sync vendored Comfy API v2 spec (cloud@f20e07a) - #37

Open
comfy-pr-bot wants to merge 1 commit into
mainfrom
chore/sync-v2-spec-f20e07a
Open

chore: sync vendored Comfy API v2 spec (cloud@f20e07a)#37
comfy-pr-bot wants to merge 1 commit into
mainfrom
chore/sync-v2-spec-f20e07a

Conversation

@comfy-pr-bot

@comfy-pr-bot comfy-pr-bot commented Jul 31, 2026

Copy link
Copy Markdown
Member

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 later
spec 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 —

scripts/gen_models.sh (datamodel-code-generator)

Summary by CodeRabbit

  • Documentation
    • Clarified API behavior for job submission rate limits and deployment readiness.
    • Documented deployment-specific errors, including guidance for retrying when a deployment is not ready.
    • Added details for terminal deployment-stopped errors and host-relative job link resolution.

@comfy-pr-bot
comfy-pr-bot requested review from a team as code owners July 31, 2026 03:51
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The OpenAPI specification now documents its generated-copy status, request-origin URL resolution, and deployment-related error codes. Job submission 429 responses distinguish queue exhaustion from deployment provisioning and define retry behavior.

Changes

OpenAPI contract updates

Layer / File(s) Summary
Generated spec and embedded URL resolution
spec/openapi.yaml
The header identifies the public generated copy. Host-relative embedded links resolve against the request origin.
Job and deployment error semantics
spec/openapi.yaml
Job submission 429 responses distinguish queue_full and deployment_not_ready. The specification documents retryable deployment_not_ready and terminal deployment_stopped errors.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: wei-hai

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the synchronization of the vendored Comfy API v2 specification and matches the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sync-v2-spec-f20e07a

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 72a64a2 and 424f15c.

📒 Files selected for processing (1)
  • spec/openapi.yaml

Comment thread spec/openapi.yaml
Comment on lines +3 to +5
# 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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/**' . || true

Repository: 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 || true

Repository: 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 || true

Repository: 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))
PY

Repository: 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.

Comment thread spec/openapi.yaml
Comment on lines +901 to +912
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".

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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.

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.

2 participants