mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #50] [MERGED] fix: expose job_id and expires_at on the public wrappers #58
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
effort:medium
effort:small
effort:small
effort:trivial
priority:nice-to-have
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-python-sdk#58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/50
Author: @wei-hai
Created: 8/13/2026
Status: ✅ Merged
Merged: 8/13/2026
Merged by: @wei-hai
Base:
main← Head:wei/expose-job-id📝 Commits (1)
75ef44dfix: expose job_id and expires_at on the public wrappers📊 Changes
5 files changed (+67 additions, -1 deletions)
View changed files
📝
src/comfy_sdk/assets.py(+17 -0)📝
src/comfy_sdk/outputs.py(+12 -0)📝
tests/conftest.py(+6 -1)📝
tests/test_assets.py(+23 -0)📝
tests/test_jobs.py(+9 -0)📄 Description
The recent spec sync added three fields to the generated models —
Output.job_id,Asset.job_id,Asset.expires_at— but the hand-written wrapper classes never surfaced any of them. A caller couldn't reach the field the change exists to provide without touching a private attribute.How it was found
End-to-end testing against Comfy Cloud staging and a self-hosted comfy-api-proxy, driving a real workflow. The value was correct on the wire from both:
Existing tests missed it because they assert on request and response bodies, never on the wrapper's surface — so the field was verified at the HTTP layer while being unreachable through the public API.
The fix
job_idonOutput/AsyncOutputandAsset/AsyncAsset, plusexpires_aton the asset.Assetdoesn't retain the full model, so those two are captured in_applyalongside the existing fields rather than passed through.Typed
str | None— genuinely absent for an uploaded asset with no producing job, so it isn't faked.Tests assert the wrapper, not the wire
That's the gap that let this ship. New tests:
output.job_idequals the producing job's id after a real run; an uploaded asset'sjob_idisNone; a committed asset'sexpires_atparses to a timezone-aware datetime. The shared fixture now stampsjob_idonto polled outputs, which it never carried before — previously there was no way to test the real value flowing through, only its absence.Verified end to end, not just in unit tests
Re-ran both environments against this branch:
output.job_idandasset.job_idboth match, PNG downloaded and verified,GET /jobs/{id}/workflowreturnsformat: apiwith the submitted graph and noextra_dataruff,ruff format,mypy, drift and hygiene clean; 140 tests pass.Noted, not fixed
Assetalso omitssize_bytes,content_type,created_atandurlfrom its wrapper — but those predate this sync and aren't part of the same regression, so widening the surface further belongs in its own change.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.