Skip to content

fix: expose job_id and expires_at on the public wrappers - #50

Merged
wei-hai merged 1 commit into
mainfrom
wei/expose-job-id
Aug 13, 2026
Merged

fix: expose job_id and expires_at on the public wrappers#50
wei-hai merged 1 commit into
mainfrom
wei/expose-job-id

Conversation

@wei-hai

@wei-hai wei-hai commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

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:

wire job_id: 94d5c5a3-db99-46e7-8dc2-90d911f8d856
SDK wrapper: <NOT EXPOSED>

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_id on Output/AsyncOutput and Asset/AsyncAsset, plus expires_at on the asset. Asset doesn't retain the full model, so those two are captured in _apply alongside 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_id equals the producing job's id after a real run; an uploaded asset's job_id is None; a committed asset's expires_at parses to a timezone-aware datetime. The shared fixture now stamps job_id onto 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:

  • Cloud staging — job succeeded, output.job_id and asset.job_id both match, PNG downloaded and verified, GET /jobs/{id}/workflow returns format: api with the submitted graph and no extra_data
  • Local ComfyUI 0.30.0 via comfy-api-proxy — same five steps pass

ruff, ruff format, mypy, drift and hygiene clean; 140 tests pass.

Noted, not fixed

Asset also omits size_bytes, content_type, created_at and url from 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

The recent spec sync added Asset.job_id, Asset.expires_at and Output.job_id
to the generated models, but the hand-written wrapper classes never surfaced
them — so a caller could not reach the field the change exists to provide
without touching a private attribute.

Found by end-to-end testing against Comfy Cloud staging and a self-hosted
proxy: the value was correct on the wire from both, and unreachable through
the public API. Existing tests missed it because they assert on the request
and response bodies, never on the wrapper's surface; the new tests assert on
the wrapper.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wei-hai
wei-hai requested review from a team as code owners August 13, 2026 18:08
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@wei-hai, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b4def27e-a616-4e59-8e52-16e993949dae

📥 Commits

Reviewing files that changed from the base of the PR and between a60d598 and 75ef44d.

📒 Files selected for processing (5)
  • src/comfy_sdk/assets.py
  • src/comfy_sdk/outputs.py
  • tests/conftest.py
  • tests/test_assets.py
  • tests/test_jobs.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@wei-hai
wei-hai merged commit 86839a0 into main Aug 13, 2026
11 checks passed
@wei-hai
wei-hai deleted the wei/expose-job-id branch August 13, 2026 18:30
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant