WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@ric-yu
Copy link
Contributor

@ric-yu ric-yu commented Dec 2, 2025

Summary

  • Add GET /api/jobs endpoint with filtering, sorting, and pagination
    • Filter by status: pending, in_progress, completed, error
    • Sort by create_time or execution_time
    • Pagination via limit/offset
  • Add GET /api/jobs/{job_id} for single job details with full outputs
  • Track execution_time in history for completed jobs
  • Include outputs_count and preview_output in job responses
  • Preview logic matches frontend (prefers type=output, supports images/video/audio/3D)

Motivation

Currently /queue and /history are separate endpoints with different response shapes. This unified API provides:

  • Consistent job representation across all states
  • Proper pagination and filtering
  • Summary fields (outputs_count, preview_output) for list views without fetching full outputs

Test plan

@ric-yu ric-yu requested a review from guill as a code owner December 2, 2025 19:23
@ric-yu ric-yu marked this pull request as draft December 2, 2025 19:24
@ric-yu ric-yu force-pushed the feature/unified-jobs-api branch 2 times, most recently from ae57e94 to c4b7a84 Compare December 2, 2025 19:52
@ric-yu ric-yu marked this pull request as ready for review December 2, 2025 20:03

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar comment to before -- likely out of scope for this, but can we start introducing some structure to this repo and start breaking up this superclass to separate files for maintainability and extensibility

execution.py Outdated
jobs = []

if status_filter is None:
status_filter = ['pending', 'in_progress', 'completed', 'error']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these statuses defined elsewhere in this file? Worth breaking out to an enum to ensure consistency within this file?

@Kosinkadink Kosinkadink added the Core Core team dependency label Dec 3, 2025
@ric-yu ric-yu marked this pull request as draft December 4, 2025 00:50
@ric-yu ric-yu marked this pull request as ready for review December 4, 2025 05:31
@ric-yu ric-yu marked this pull request as draft December 4, 2025 05:31
@ric-yu ric-yu marked this pull request as ready for review December 4, 2025 07:52
@ric-yu ric-yu force-pushed the feature/unified-jobs-api branch from 57fd19f to c860cc6 Compare December 4, 2025 20:53
@ric-yu
Copy link
Contributor Author

ric-yu commented Dec 4, 2025

Rebasing

@comfyanonymous
Copy link
Owner

Can you test this properly? The endpoint doesn't work after I run a regular workflow.

@ric-yu
Copy link
Contributor Author

ric-yu commented Dec 9, 2025

Can you test this properly? The endpoint doesn't work after I run a regular workflow.

Fixed an issue with preview as text. This endpoint has been working for me otherwise, but I'm stuck with testing light workflows since I'm on a Mac

@ric-yu ric-yu force-pushed the feature/unified-jobs-api branch from c5c3db7 to 1f7c1a9 Compare December 9, 2025 20:03
@ric-yu ric-yu force-pushed the feature/unified-jobs-api branch from 1371f61 to ed61899 Compare December 12, 2025 00:25
@ric-yu
Copy link
Contributor Author

ric-yu commented Dec 12, 2025

rebasing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core Core team dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants