[PR #49] [MERGED] chore: sync the v2 spec and wire every operation it declares #59

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

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-typescript-sdk/pull/49
Author: @wei-hai
Created: 8/13/2026
Status: ✅ Merged
Merged: 8/13/2026
Merged by: @wei-hai

Base: main ← Head: wei/sync-v2-spec-complete


📝 Commits (7)

  • 66ae9be feat: add job.workflow() to fetch the graph that produced a job
  • cee17de chore: sync vendored Comfy API v2 spec from cloud@7c65b1a
  • 6bd601e fix: append /workflow when getJobWorkflow is given a job URL
  • 01552f0 feat: add asset deletion
  • 2ac8008 chore: regenerate the low layer for the synced spec
  • 09cc227 Merge remote-tracking branch 'origin/wei/fetch-job-workflow' into wei/sync-v2-spec-complete
  • f3479dd Merge remote-tracking branch 'origin/wei/asset-delete' into wei/sync-v2-spec-complete

📊 Changes

12 files changed (+586 additions, -31 deletions)

View changed files

📝 spec/openapi.yaml (+136 -18)
📝 src/low/generated/index.ts (+1 -1)
📝 src/low/generated/types.gen.ts (+131 -3)
📝 src/low/generated/zod.gen.ts (+42 -5)
📝 src/low/index.ts (+2 -0)
📝 src/low/transport.test.ts (+59 -0)
📝 src/low/transport.ts (+55 -1)
📝 src/sdk/assets.test.ts (+29 -1)
📝 src/sdk/assets.ts (+19 -0)
📝 src/sdk/jobs.test.ts (+25 -1)
📝 src/sdk/jobs.ts (+26 -1)
📝 test/support/stub-server.ts (+61 -0)

📄 Description

Brings the vendored Comfy API v2 spec up to date and leaves CI green, which the automated sync PR can't do alone: spec-coverage.test.ts asserts OPERATION_IDS matches the spec exactly, so a sync that introduces operations without wrappers always fails.

The synced spec introduces two: getJobWorkflow and deleteAsset. Both are implemented here.

What's in it

  • Vendored spec synced from the canonical contract (cloud@7c65b1a), plus the regenerated low layer
  • getJobWorkflow — Job.getWorkflow() returns the graph and a format discriminator (save = the authoring workflow at the version the job ran; api = the executed graph). Callers must branch on it — which shape comes back depends on how the job was submitted
  • deleteAsset — Asset.delete() and assets.delete(id), mirroring the Python SDK
  • Both registered in OPERATION_IDS / OPERATION_METHODS and moved onto the generated types, so no hand-rolled request survives

One fix worth a look

getJobWorkflow originally reused the "id or URL" pattern from getJob/cancelJob/getJobEvents, treating a URL input as the final target. That's right for those three — each receives a pre-built link. But JobUrls declares only self, events and cancel; there's no workflow link, so a URL passed here is the job's own address and still needs /workflow appended. Previously, passing job.urls.self silently fetched the job and mistyped it as a workflow result with workflow/format undefined.

jobBasePath() now normalizes both input forms, with tests for the relative and absolute cases — which had no coverage.

Verification

lint, format, typecheck, spec-drift, hygiene and build all clean; 167/167 tests pass, including all four spec-coverage assertions — honestly, not by exclusion. All 11 spec operations have real methods on ComfyLow.prototype.

Supersedes the automated sync PR and the two feature branches it folds in.

🤖 Generated with Claude Code


🔄 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-typescript-sdk/pull/49 **Author:** [@wei-hai](https://github.com/wei-hai) **Created:** 8/13/2026 **Status:** ✅ Merged **Merged:** 8/13/2026 **Merged by:** [@wei-hai](https://github.com/wei-hai) **Base:** `main` ← **Head:** `wei/sync-v2-spec-complete` --- ### 📝 Commits (7) - [`66ae9be`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/66ae9bebd4375a97c8d4b4abac3e089e228fdc07) feat: add job.workflow() to fetch the graph that produced a job - [`cee17de`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/cee17de5caf3d2ca0da4c404298dbd200fdfddc4) chore: sync vendored Comfy API v2 spec from cloud@7c65b1a - [`6bd601e`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/6bd601e8bb9942f3d1e62ec57d41ab2f60e1f517) fix: append /workflow when getJobWorkflow is given a job URL - [`01552f0`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/01552f0a811304f86a2434f0e2a3505ba75e0adf) feat: add asset deletion - [`2ac8008`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/2ac8008b3edaecf31c599ff505150ab590ed3b2f) chore: regenerate the low layer for the synced spec - [`09cc227`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/09cc227766c62ba0a61fb6de267aa7a403706a3e) Merge remote-tracking branch 'origin/wei/fetch-job-workflow' into wei/sync-v2-spec-complete - [`f3479dd`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/f3479dd1688fe35b896214bccf6480e7e297e9b1) Merge remote-tracking branch 'origin/wei/asset-delete' into wei/sync-v2-spec-complete ### 📊 Changes **12 files changed** (+586 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `spec/openapi.yaml` (+136 -18) 📝 `src/low/generated/index.ts` (+1 -1) 📝 `src/low/generated/types.gen.ts` (+131 -3) 📝 `src/low/generated/zod.gen.ts` (+42 -5) 📝 `src/low/index.ts` (+2 -0) 📝 `src/low/transport.test.ts` (+59 -0) 📝 `src/low/transport.ts` (+55 -1) 📝 `src/sdk/assets.test.ts` (+29 -1) 📝 `src/sdk/assets.ts` (+19 -0) 📝 `src/sdk/jobs.test.ts` (+25 -1) 📝 `src/sdk/jobs.ts` (+26 -1) 📝 `test/support/stub-server.ts` (+61 -0) </details> ### 📄 Description Brings the vendored Comfy API v2 spec up to date **and leaves CI green**, which the automated sync PR can't do alone: `spec-coverage.test.ts` asserts `OPERATION_IDS` matches the spec exactly, so a sync that introduces operations without wrappers always fails. The synced spec introduces two: `getJobWorkflow` and `deleteAsset`. Both are implemented here. ## What's in it - **Vendored spec** synced from the canonical contract (`cloud@7c65b1a`), plus the regenerated low layer - **`getJobWorkflow`** — `Job.getWorkflow()` returns the graph *and* a `format` discriminator (`save` = the authoring workflow at the version the job ran; `api` = the executed graph). Callers must branch on it — which shape comes back depends on how the job was submitted - **`deleteAsset`** — `Asset.delete()` and `assets.delete(id)`, mirroring the Python SDK - Both registered in `OPERATION_IDS` / `OPERATION_METHODS` and moved onto the generated types, so no hand-rolled request survives ## One fix worth a look `getJobWorkflow` originally reused the "id or URL" pattern from `getJob`/`cancelJob`/`getJobEvents`, treating a URL input as the final target. That's right for those three — each receives a pre-built link. But `JobUrls` declares only `self`, `events` and `cancel`; there's no `workflow` link, so a URL passed here is the **job's own address** and still needs `/workflow` appended. Previously, passing `job.urls.self` silently fetched the job and mistyped it as a workflow result with `workflow`/`format` undefined. `jobBasePath()` now normalizes both input forms, with tests for the relative and absolute cases — which had no coverage. ## Verification lint, format, typecheck, spec-drift, hygiene and build all clean; **167/167 tests pass**, including all four `spec-coverage` assertions — honestly, not by exclusion. All 11 spec operations have real methods on `ComfyLow.prototype`. Supersedes the automated sync PR and the two feature branches it folds in. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 22:04:12 +00:00
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-typescript-sdk#59
No description provided.