[PR #117] [MERGED] fix(models): follow Comfy Router's move to /v2/models #115

Closed
opened 2026-10-31 22:01:32 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/117
Author: @mattmillerai
Created: 8/31/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @mattmillerai

Base: main ← Head: matt/router-v2-path


📝 Commits (6)

  • 6832f78 chore: sync vendored Comfy Router spec from cloud@b7481bb
  • 33c9a91 fix(models): follow Comfy Router's move to /v2/models (route drift left every models.run a 404)
  • c563f41 fix(retry): reconcile the run route's 409/idempotency semantics with the synced router contract
  • 43c9ad0 style: rewrap a retry.py docstring line past the 100-column ruff bound
  • 1792df9 style: ruff-format the new idempotency-key validator
  • edd069c fix: strip invalid escape sequences the docstring edits introduced

📊 Changes

15 files changed (+370 additions, -115 deletions)

View changed files

📝 CHANGELOG.md (+19 -0)
📝 README.md (+4 -4)
📝 spec/router-openapi.yaml (+70 -19)
📝 src/comfy_low/errors.py (+19 -1)
📝 src/comfy_low/transport.py (+6 -6)
📝 src/comfy_sdk/_core.py (+27 -0)
📝 src/comfy_sdk/client.py (+1 -1)
📝 src/comfy_sdk/models.py (+25 -10)
📝 src/comfy_sdk/retry.py (+57 -40)
📝 src/comfy_sdk/router_exceptions.py (+25 -7)
📝 tests/conftest.py (+25 -7)
📝 tests/test_error_mapping.py (+1 -1)
📝 tests/test_models_run.py (+11 -11)
📝 tests/test_models_run_retry.py (+78 -6)
📝 tests/test_transport_security.py (+2 -2)

📄 Description

What

The Comfy Router service moved its model routes from /v1/models/{provider}/{model} to /v2/models/…. The SDK's hand-written path template still said /v1, so every models.run against the live service answered a bare 404 — caught by the first-ever live run of the two-SDK Router smoke suite, and reproduced with a raw curl (/v2 → 200 with a real generation, the SDK's path → 404).

This PR includes the open vendored-spec sync PR (which was sitting red precisely because the synced spec moved to /v2 while the code said /v1) and flips the path template, docs, and tests to match, so the spec↔code contract check passes again.

Verified

  • Full test suite green locally (python: 694 passed / ts: 389 passed; the 17 credentials.test.ts failures on the TS side pre-exist on the sync base unchanged — local Node environment, not this change)
  • Hygiene + drift/contract checks pass locally
  • Live: raw POST to /v2/models/recraft/recraftv2 on staging returns 200 with a generation; the /v1 path 404s

🤖 Generated with Claude Code

Supersedes #116 (merging this closes it). Sibling: Comfy-Org/comfy-typescript-sdk#110.


🔄 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-python-sdk/pull/117 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 8/31/2026 **Status:** ✅ Merged **Merged:** 8/31/2026 **Merged by:** [@mattmillerai](https://github.com/mattmillerai) **Base:** `main` ← **Head:** `matt/router-v2-path` --- ### 📝 Commits (6) - [`6832f78`](https://github.com/Comfy-Org/comfy-python-sdk/commit/6832f78b7ba398051c04a21b1f32e8932aaa0761) chore: sync vendored Comfy Router spec from cloud@b7481bb - [`33c9a91`](https://github.com/Comfy-Org/comfy-python-sdk/commit/33c9a9157c77ea54c4ee0f636e3061a63b371e0b) fix(models): follow Comfy Router's move to /v2/models (route drift left every models.run a 404) - [`c563f41`](https://github.com/Comfy-Org/comfy-python-sdk/commit/c563f4109c2c6b13fa7013d0d23aa040f208d2a3) fix(retry): reconcile the run route's 409/idempotency semantics with the synced router contract - [`43c9ad0`](https://github.com/Comfy-Org/comfy-python-sdk/commit/43c9ad00ed99df9e3691ac1563b1bcece2facebf) style: rewrap a retry.py docstring line past the 100-column ruff bound - [`1792df9`](https://github.com/Comfy-Org/comfy-python-sdk/commit/1792df91854de098c5442c5248c4bab3b83583c5) style: ruff-format the new idempotency-key validator - [`edd069c`](https://github.com/Comfy-Org/comfy-python-sdk/commit/edd069c8dfa7bf9081202590423687dfe8541162) fix: strip invalid escape sequences the docstring edits introduced ### 📊 Changes **15 files changed** (+370 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+19 -0) 📝 `README.md` (+4 -4) 📝 `spec/router-openapi.yaml` (+70 -19) 📝 `src/comfy_low/errors.py` (+19 -1) 📝 `src/comfy_low/transport.py` (+6 -6) 📝 `src/comfy_sdk/_core.py` (+27 -0) 📝 `src/comfy_sdk/client.py` (+1 -1) 📝 `src/comfy_sdk/models.py` (+25 -10) 📝 `src/comfy_sdk/retry.py` (+57 -40) 📝 `src/comfy_sdk/router_exceptions.py` (+25 -7) 📝 `tests/conftest.py` (+25 -7) 📝 `tests/test_error_mapping.py` (+1 -1) 📝 `tests/test_models_run.py` (+11 -11) 📝 `tests/test_models_run_retry.py` (+78 -6) 📝 `tests/test_transport_security.py` (+2 -2) </details> ### 📄 Description ## What The Comfy Router service moved its model routes from `/v1/models/{provider}/{model}` to `/v2/models/…`. The SDK's hand-written path template still said `/v1`, so every `models.run` against the live service answered a bare 404 — caught by the first-ever live run of the two-SDK Router smoke suite, and reproduced with a raw curl (`/v2` → 200 with a real generation, the SDK's path → 404). This PR **includes the open vendored-spec sync PR** (which was sitting red precisely because the synced spec moved to /v2 while the code said /v1) and flips the path template, docs, and tests to match, so the spec↔code contract check passes again. ## Verified - Full test suite green locally (python: 694 passed / ts: 389 passed; the 17 `credentials.test.ts` failures on the TS side pre-exist on the sync base unchanged — local Node environment, not this change) - Hygiene + drift/contract checks pass locally - Live: raw POST to `/v2/models/recraft/recraftv2` on staging returns 200 with a generation; the `/v1` path 404s 🤖 Generated with [Claude Code](https://claude.com/claude-code) Supersedes #116 (merging this closes it). Sibling: Comfy-Org/comfy-typescript-sdk#110. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
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-python-sdk#115
No description provided.