Skip to content

Tasks Tab

Overview

The Tasks tab (TasksPage.qml, route Tasks) acts as the unified activity monitor for long-running operations across both the local workstation (QuPath imports, dataset builds, local tasks) and the FastAPI backend (remote training, inference, SSH node setup logs).

Tasks header with Refresh and Clear Completed controls, segmented status tabs (All, Running, Completed, Failed), and active task cards.

Availability & Prerequisites

  • Active Project Required: No — displays global and project-scoped task history tracked by taskHistoryViewModel.
  • Server Connectivity: Backend-owned jobs synchronize when signed in / connected to an orchestrator profile.

Step-by-Step User Workflows

1. Filter and Refresh Tasks

  1. Click All, Running, Completed, or Failed across the segmented filter bar to focus on specific task states (each tab displays live counts).
  2. Click Refresh (tasksRefreshButton) in the header to trigger immediate backend reconciliation (taskVm.refresh_now()).
  3. Click Clear Completed once satisfied with historical local tasks (visible whenever completedCount > 0).

2. Inspect Logs & Download Verified Model Packages

  • Open Task logs (remoteLogsDialog) on a job or SSH node setup task to view streaming monospace output (JetBrains Mono), automatically scrolling to the latest line.
  • For completed backend training tasks, click download to open Save verified model package (taskPackageDialog), choose a destination .zip file path, and wait for "Model package verified" confirmation (digest-checked before completion).

3. Cancel, Force Stop, or Force Delete Stuck Tasks

  • Force stop backend job (forceStopDialog): Finalizes cancellation on a backend-owned job by ID. If a remote GPU host is temporarily unreachable, the backend marks the job cancelled and performs worker cleanup once reconnected.
  • Force Delete Stuck Task (forceDeleteDialog): For purely local stuck records, deletes the task entry and dismisses its background status. Backend-owned jobs cannot be deleted from history while still running — stop them first and delete only after reaching a terminal state.
flowchart TD
    Submit["Task Submitted (Dataset / Training / Inference / SSH Setup)"] --> Filter["Visible under All & Running"]
    Filter -->|Completes| Done["Moves to Completed (Model .zip Download / Clear Completed)"]
    Filter -->|Fails / Times Out| Failed["Moves to Failed (Inspect Task Logs)"]
    Filter -->|Stuck / Cancel| StopChoice{"Backend-owned\njob?"}
    StopChoice -->|Yes| ForceStop["Force stop backend job -> Terminal Cancelled"]
    StopChoice -->|No| ForceDel["Force Delete local stuck record"]

UI Controls & Status Dialogs Reference

Header & Filter Bar

Control Identifier Behavior
Refresh tasksRefreshButton Triggers refresh_now(); enters spinning "Refreshing…" loading state while querying backend
Clear Completed Header secondary button Shown only when completedCount > 0; clears finished local task entries
Status Tabs All (N), Running (N), Completed (N), Failed (N) Calls taskVm.set_filter(key) with instant count updates

Dialogs & Toast Alerts

Element Trigger / Signal Purpose & Constraints
remoteLogsDialog (Task logs) View logs action / onLogsDialogRequested Scrollable read-only plain-text stream (680×420); stops log tailing cleanly onClosed
forceStopDialog (Force stop backend job) Force stop on backend job Shows backend job_id; buttons: Keep task (forceStopCancelButton), Force stop (forceStopConfirmButton)
forceDeleteDialog (Force Delete Stuck Task) Force delete on local/stuck record Explains distinction between local dismissal and backend-owned jobs
taskPackageDialog (Save verified model package) Download trained .zip artifact Saves *.zip package via digest-verified download
Runtime Warning Toasts onCudaOomWarning, onDeviceFallbackWarning, onOperationFailed Surfaces GPU Out-of-Memory (warning), CPU fallback notices (warning), and failures (error)

Technical Reference

  • Ownership Boundary: Backend jobs are authoritative on the FastAPI control plane; the desktop cannot delete active backend job history until the backend transitions the job to a terminal state (completed, succeeded, failed, timed_out, or cancelled).
  • On-Mount Refresh: Entering Tasks invokes taskVm.refresh_local() automatically while background polling reconciles remote jobs.