MCP: the Render queue and wait_for_jobs (#193) #207
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio!207
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-193-mcp-queue"
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?
Closes #193. Part of #157.
What changed
read_queuereturns the Render queue's controls (paused, holdFinals, reopened, comfyOffline) and its jobs, as the Queue panel shows them.set_queue_paused,set_hold_finals,hold_job,move_job,run_jobs_next,cancel_jobanddismiss_job. Each one calls the existingApiImplcommand and returnsread_queue.wait_for_jobs(jobIds, timeoutSeconds)blocks until every job is done or cancelled. It returns early on a failed job, when ComfyUI is offline, when the queue is paused with a job still waiting, and when a waiting job is on hold. Otherwise it returnstimedOut. The timeout is capped at 600 s. The reply gives each job's state:queued,running,done,failed(with the error) orcancelled.ProgressListenersnow holds both window channels and MCP waits.ProjectSession::job_statusesreads a job's state whether or not the queue still shows it, so a wait can tell done, failed and cancelled jobs apart.Beyond the issue
heldis an extra early-return outcome. A job on hold never starts, so waiting for the full timeout would do nothing.Tests
src-tauri/tests/mcp_queue.rshas 13 tests at the MCP boundary:cancelledThe full workspace suite passes. Clippy shows the same warnings as
main.