Skill v1.0.1
Automated scan100/100+2 new, ~1 modified
name: edit-jobs description: Cancels active backend jobs running past a threshold instead of restarting the worker running them. Dry run unless apply is true. Use when a job looks stuck. compatibility: Reading the skill needs nothing. To run its analyses against Forward: the fwdctl binary on PATH and FORWARD_URL, FORWARD_USERNAME and FORWARD_PASSWORD in the environment. metadata: version: "1.0.1" cluster: "investigate" summary: "cancel jobs stuck past a threshold" maturity: "1" class: write effect: "org" secrets: "false" reversible: "false" tools: "jobs"
edit-jobs
Intent
A job that has run past Forward's own NQE_JOB_TIMEOUT_MINUTES (default 20) is doomed by Forward's own definition: its orchestration layer has already given up on it even if the worker thread computing it has not stopped, and nothing upstream will clear it on its own. The alternative to this skill is restarting the worker pod running the job, which kills every OTHER job that worker happens to be running too. This skill finds the specific job and cancels it (DELETE /api/jobs/{cancelLink}, the same action Forward's own GUI and Forward support use), leaving the rest of the worker's work alone.
It is meant to run unattended on a schedule as the first response to a wedged job, before anyone reaches for a pod restart.
Inputs
What each input means, and the fields per object and action: fwdctl run edit-jobs --help, or reference/inputs.md.
Dry run
Lists every job past the threshold as a planned cancel_job change (job type, network, snapshot if any, how long it has run, its cancel_link). Nothing is sent to Forward. Always run the dry run first when driving this by hand; a scheduled/unattended caller may go straight to apply: true -- that is exactly the case this skill exists for.
Apply
Cancels each matched job (Jobs.Cancel in the SDK terms). Not reversible: canceling ends the job; nothing restores it, and rerunning the same NQE query or operation is a new job, not an undo. A job already finished or already canceled by the time this runs is reported as a failed cancellation for that one row, not a crash of the whole run -- status is failed only if at least one matched job could not be canceled; jobs that did cancel are still reported as canceled.
Refusals
network_id that is not a number; older_than_minutes negative.
Procedure
GET /api/jobs/active. Filter tonetwork_id(if given) and jobs whoselongest_running_time_seconds >= older_than_minutes*60, or, for a job atrunning: 0(queued the whole time), whoseduration_secondsis at least that.- Nothing matched: ok, "nothing is stuck".
- More than
limitmatched: cancel (or plan) only the firstlimit, and say so in the omission. - Dry run: return the plan.
apply: true:DELETE /api/jobs/{cancelLink}for each, per-job success or failure.
Evidence
One state item: the threshold, how many matched, and the canceled/failed lists with what each row was.
Next actions
inspect-jobs to confirm nothing past the threshold remains, or to see what is still running if some cancellations failed.
Running this skill
Run fwdctl run edit-jobs --help for the inputs and an example, then give them as one JSON object on stdin: fwdctl run edit-jobs < input.json. It is a dry run unless the input has "apply": true; add that only after the dry run was accepted. Read status (ok, failed, unknown, error), mode and the limits; unknown is never a pass.
Examples
echo '{}' | fwdctl run edit-jobsecho '{"apply": true}' | fwdctl run edit-jobsecho '{"network_id": "4610", "older_than_minutes": 20, "apply": true}' | fwdctl run edit-jobs