feat: add asset delete - #41
Conversation
|
✅ All contributors have signed the CLA. Thank you! This PR is ready to be merged. |
|
Warning Review limit reached
Next review available in: 6 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAsset deletion is now available through synchronous and asynchronous low-level clients, asset handles, and asset factories. Committed asset handles clear their stored IDs after successful deletion. Tests cover request handling, deletion counts, state clearing, and uncommitted assets. ChangesAsset deletion
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AssetHandle
participant SDKClient
participant ComfyLow
participant AssetAPI
AssetHandle->>SDKClient: Delete committed asset
SDKClient->>ComfyLow: Send DELETE request
ComfyLow->>AssetAPI: DELETE /assets/{asset_id}
AssetAPI-->>ComfyLow: Return HTTP 204
ComfyLow-->>SDKClient: Return success
SDKClient-->>AssetHandle: Clear stored asset ID
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 |
|
I have read and agree to the Contributor License Agreement |
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 `@src/comfy_low/transport.py`:
- Around line 344-348: Update the `/api/v2/assets/{id}` definition in
`spec/openapi.yaml` to add a `deleteAsset` DELETE operation with the appropriate
success `204` response and existing error responses, then regenerate the OpenAPI
bindings so synchronous and asynchronous `delete_asset` remain contract-aligned.
In `@tests/conftest.py`:
- Around line 178-188: The test server’s do_DELETE method must model resource
removal instead of only counting requests. Capture the matched asset ID in the
server’s deleted-resource state, make the existing metadata and content GET
handlers return the API’s 404 for deleted IDs, and update both synchronous and
asynchronous instance tests to verify subsequent requests for that ID receive
404 responses.
🪄 Autofix
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: 61042060-7667-4c9c-bf17-ec7492f06cdb
📒 Files selected for processing (5)
src/comfy_low/transport.pysrc/comfy_sdk/assets.pytests/conftest.pytests/test_assets.pytests/test_async.py
The required post-sync step: scripts/gen_models.sh against the newly vendored spec, so the drift gate passes. Picks up JobWorkflowResponse and the new job_id/expires_at fields on Asset and Output. Coverage still fails until the two new operations have transport wrappers — getJobWorkflow (#47) and deleteAsset (#41) — since OPERATION_IDS must match the spec exactly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat: add asset delete
* address coderabbit PR comments
* address coderabbit PR comments
* feat: add get_workflow() to fetch the graph that produced a job
A caller holding a job — including one rehydrated by id — had no way to see
the workflow behind it. The SDK holds the graph only when it submitted the
job in the same process; otherwise it is gone.
Calls GET /api/v2/jobs/{id}/workflow and returns both the graph and the
format discriminator. "api" is the executed graph, with editor-only
constructs already resolved away; "save" is the authoring workflow at the
version the job ran. Returning the discriminator matters: a caller must be
able to tell which shape it holds.
Written by hand rather than through the generated client, because the
vendored spec does not describe this endpoint yet. It moves onto the
generated client once the spec re-syncs.
Named to match the existing get_download_url(), and mirrored as getWorkflow()
in the TypeScript SDK.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore: sync vendored Comfy API v2 spec from cloud@7c65b1a
* chore: regenerate comfy_low models for the synced spec
The required post-sync step: scripts/gen_models.sh against the newly vendored
spec, so the drift gate passes. Picks up JobWorkflowResponse and the new
job_id/expires_at fields on Asset and Output.
Coverage still fails until the two new operations have transport wrappers —
getJobWorkflow (#47) and deleteAsset (#41) — since OPERATION_IDS must match
the spec exactly.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore: wire the synced spec's new operations into comfy_low
Registers getJobWorkflow and deleteAsset in OPERATION_IDS/OPERATION_METHODS,
moves get_job_workflow onto the generated JobWorkflowResponse model, and
fixes six delete-asset test call sites that still passed the base URL
positionally after that constructor argument was replaced by COMFY_BASE_URL.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: jab416171 <jab416171@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: wei-hai <2936715+wei-hai@users.noreply.github.com>
Summary by CodeRabbit
New Features
Bug Fixes
Tests