Skip to content
Scheduled maintenance

Scheduled maintenance

The Background tasks view shows Ocman’s owner-local scheduled maintenance alongside history imports and preparation work. Open Activity and select Background tasks, or use the bgt counter. The view defaults to this machine. When remotes exist, the tab-like machine control at the far right opens a chooser. Selecting a remote requests only that owner’s tasks. Offline or unavailable owners show an error instead of falling back to this machine. Ownership and scope remain in task details.

The overview is a scrollable table without pagination. Tasks are grouped into Housekeeping, Session and runtime coordination, Notifications and plugins, Scheduled automation and synchronization, Metrics and accounting, and History synchronization. Unrecognized tasks appear under Other tasks. Empty categories are hidden. Within each category, tasks sort alphabetically by name, with task identity breaking ties. Each row shows the task, latest status and last-run time. Select a row to open its detail panel beside the table, or below it on narrow screens. Progress, counters, errors and the five latest available runs appear only in that panel. Expand a recent run to inspect its progress and error. Unknown totals use an indeterminate bar only while running, never an invented percentage. Machines, kinds, keys and scopes remain separate. An active run takes precedence over a newer finished run. Status filters apply to that current run’s result, not older history. Filters, machine and selected group survive reloads and browser Back through the URL. Text selection does not open a row.

    flowchart LR
    Selector[Machine tab and chooser] --> Request[Owner-scoped task query]
    Request --> Hub[Hub task API]
    Hub --> Local[Local task reader]
    Hub --> Remote[Selected remote reader]
    Local --> Groups[Category and name ordering]
    Remote --> Groups
    Groups --> Table[Scrollable task table and details]
  

The browser queries one owner with remoteId, and keys its polling cache by machine. Switching machines clears the selected task without discarding unrelated URL parameters. It never combines local and remote rows in the same overview.

Each recurring job keeps one entry with its latest result, progress counters, cadence, run count and next-check hint. An idle recurring job is not running work. After a successful pass, the table keeps its “Succeeded” result; the detail panel shows “Waiting for next run” when a next-check hint exists. Failures remain visible even when another check is scheduled. The run count comes from the schedule, not the number of retained history records. Recurring jobs retain only their latest run. The table and detail panel are limited to the API’s 200 available records; older tasks and runs may not appear. The counter counts only queued/running entries. Restarting Ocman clears stale next-check hints until the loops run again. Jobs that stop also clear their hints. The hint is approximate: slow passes, event-triggered runs and timer alignment can change when a check actually starts.

Tracked jobs

WorkSchedule
Archived worktree cleanupStartup and hourly
Auto-archiveDaily, with shorter retries while session preparation is pending
Expired composer attachmentsStartup and daily
Snoozed session wake-upsStartup and every minute
Project index and connected remote project inventoriesExisting refresh intervals
Watched pull requests and scheduled routinesExisting watch/check intervals
Idle project runtime checks and queued-message recoveryStartup and every minute
Agent approval subscription reconciliationExisting rescan interval
Inbox permission reconciliationExisting reconciliation interval
Web notification candidate checks and deliveryExisting polling interval and delivery wake-ups
Webhook inbox polling and delivery-history cleanupPer inbox every 15 seconds; history hourly
Plugin conversation/session reconciliation, delivery scans and history pruningExisting reconciliation, retry and prune intervals
Session-reference recovery and pending platform reload checksExisting recovery/reload intervals
Managed runtime health, machine runtime supervision and installed-version checksExisting health/supervision intervals
Database-size sampling, subscription usage and analytics metricsExisting sampling intervals, when enabled
Consumed history journal segment pruningHourly per journal source

Cleanup reports removed, retained and already-removed checkouts plus unavailable owners. Other jobs report counters where available. A percentage appears only when the producer knows the total. A successful check does not mean it changed anything. Webhook and notification delivery failures use generic task errors so task history does not retain private endpoints or credentials.

Internal timers

Transport heartbeats, SSE keepalives, connection retries, debounce delays, subscription expiry, process shutdown grace periods and lock/capacity waits are not standalone maintenance tasks. Provider-internal history indexing and Factory dispatch retain their existing domain status rather than creating recurring Background tasks entries. History ingestion already records actual sync work; its idle journal/feed polls do not create receipts.

Observations do not enqueue another execution or bypass mutation fences. Queued messages, routine runs and agent executions keep their own recovery records.

Recurring jobs use an in-memory overlap guard, not their last persisted status, to decide whether another iteration may run. A failed completion-receipt write can leave a stale running entry, but cannot stop later iterations after storage recovers. A deadline never authorizes overlapping a call that has not returned.

Webhook relay requests time out after 30 seconds. Each inbox poll has a two-minute budget, including routine launch work, and each history sweep has a one-minute budget. These deadlines cancel individual passes without cancelling the module’s lifetime or stopping an already-launched routine session. Cancellation is cooperative; dependencies must honor their context. Later passes receive fresh budgets and retain delivery deduplication and retry rules.