Skip to content

feat(creative): implement task cancellation, engine interrupt, and cloud actions (R07-R09, R14, L07) - #7

Merged
BerryUIKI merged 1 commit into
devfrom
feature/cancellation-and-cloud-actions
Sep 23, 2026
Merged

BerryUIKI merged 1 commit into
devfrom
feature/cancellation-and-cloud-actions

Conversation

@BerryUIKI

Copy link
Copy Markdown
Owner

Summary

This PR implements comprehensive task cancellation, local engine interruption (ComfyUI & WebUI), active-task shutdown guards, and multi-action cloud execution (inpainting, upscaling, img2img, txt2img).

Key Changes

  • Local Engine Interruption:
    • ComfyUIClient.interrupt: Dispatches POST /interrupt to running ComfyUI instances.
    • WebUIRunner.interrupt: Dispatches POST /sdapi/v1/interrupt to running Stable Diffusion WebUI instances.
  • Creative Runner Active Task & Cancellation Management:
    • Added active_tasks and active_cancellations registration to CreativeRunner.
    • Added cancel_task(task_id) which signals engine interruption for local engines and truthfully discloses remote computation limitations for cloud providers (R14).
  • Cloud Action Dispatch:
    • Implemented _run_cloud across all 4 image actions: txt2img, img2img, inpaint (OpenAI / Fal.ai), and upscale (Fal.ai).
    • Unsupported combinations explain clearly what is missing (R07).
  • API Endpoints:
    • GET /api/v1/tasks/active: Lists all running generation and workflow DAG tasks.
    • POST /api/v1/tasks/{task_id}/cancel: Cancels in-flight creative action.
    • POST /api/v1/workflow/cancel/{run_id}: Cancels in-flight DAG workflow.
    • POST /api/v1/manager/shutdown: Guards both creative runner tasks and workflow tasks against silent termination (L07).
  • Test Suite:
    • Added backend/tests/test_cancellation_and_actions.py covering task cancellation, cloud disclosures, shutdown guards, and engine interrupt dispatch.

@BerryUIKI
BerryUIKI merged commit 6746118 into dev Sep 23, 2026
3 checks passed
@BerryUIKI
BerryUIKI deleted the feature/cancellation-and-cloud-actions branch October 4, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant