mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #50] [MERGED] fix: expose jobId and expiresAt on the public wrappers #60
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
bug
cursor-review-pin
effort:medium
effort:small
effort:trivial
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-typescript-sdk#60
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-typescript-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)
9e88b40fix: expose jobId and expiresAt on the public wrappers📊 Changes
5 files changed (+40 additions, -1 deletions)
View changed files
📝
src/sdk/assets.test.ts(+9 -0)📝
src/sdk/assets.ts(+14 -0)📝
src/sdk/outputs.test.ts(+9 -0)📝
src/sdk/outputs.ts(+5 -0)📝
test/support/stub-server.ts(+3 -1)📄 Description
The recent spec sync added
job_idandexpires_atto the generated types, but the hand-written wrapper classes never surfaced them. A caller couldn't reach the field the change exists to provide.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, and unreachable through the public API.
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 invisible to users.
The fix
jobIdon the output wrapper, plusjobIdandexpiresAton the asset.Assetdoesn't hold the full server model — onlyid/hash/createdNeware pulled out inadopt()— so these follow that same cached-field pattern rather than a pass-through.Typed
string | undefined: genuinely absent for an uploaded asset with no producing job, and beforecommit(). Not faked.Tests assert the wrapper, not the wire
That's the gap that let this ship. New tests cover
output.jobIdafter a real job poll,undefinedwhen the model omits it, and an uploaded asset'sjobId/expiresAtbeingundefinedbefore and aftercommit(). The stub server now stampsjob_idonto polled outputs, which it never carried — so theJob→Outputwiring is exercised rather than only a hand-builtOutput.Verification
oxlint, oxfmt, tsc, spec-drift, hygiene and build all clean; 169 tests pass.
The Python SDK carries the identical fix, keeping the two in lockstep, and was additionally re-verified end to end against Cloud staging and a local ComfyUI through the proxy.
One typing note for a reviewer
expiresAtreturns the raw ISOstring, not aDate. TheDateconversion elsewhere (getDownloadUrl()) is computed from response headers rather than a model field, so extending it here would have been a wider change than this fix warrants — worth a look ifDateconsistency across the SDK is wanted.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.