Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Classifies orphan tasks left in a workspace's tasks folder after a crash as done, fresh, or stale, then archives or recovers each.
19% 90%+71 ptsof test cases passed
Passed 19 of 21 test cases with the skill, and 4 of 21 without it.
This test ran on v3. v4 is the current version and hasn’t been tested on gemini-3.8-flash yet.
3 of 3 safety checks passed
Not used yet
Recovery half of the post-#1049 task-bridge redesign. Replaces the brittle attempts-counter (#1049 + #1066's followup) with a startup-time classification pass that uses existing side-effect markers (PR #1048's .sending files for Discord, result files in results/, archive presence) to decide what to do with each live task in <workspace>/tasks/.
Usage: /task-orphan-check
Designed to be invoked from /startup (PR #1072) as step 1, before /schedule-crons starts the task watcher. Also callable standalone for manual recovery.
If the agent crashes mid-task with non-idempotent side effects already executed (Discord message sent, file written, API call made) but the archive of result + task files never ran, on restart the task file is still in tasks/. The watcher re-emits it. The agent re-processes. The side effect fires a second time.
PR #1049 tried to solve this with an attempts: N counter inside the task file — but the bumper-write fired the watcher's own Renamed event, creating an infinite self-trigger loop. PR #1066 tried to patch the loop by switching to in-place writes — but on macOS, open(file, 'w') STILL fires the Created event because O_WRONLY|O_CREAT|O_TRUNC flips the ItemCreated bit. Both PRs are working around the wrong layer.
This skill moves the dedup logic out of the watcher's event surface entirely. The agent does a single classification pass at startup, cross-references markers that already exist (PR #1048 ships them for Discord delivery; result files in results/ mark "this task was completed"), and decides per-task what to do. No counter, no in-band writes, no self-trigger loop.
The procedure below is non-LLM where possible — mechanical file checks + side-effect marker reads. The LLM-judgment parts are bounded (per-task classification with explicit decision rules).
WS="$(bash scripts/sutando-config.sh workspace)"
ls "$WS/tasks/"task-*.txt 2>/dev/null | head -200
If no live tasks, emit "orphan-check: no live tasks, nothing to recover" and idle.
Run the classifier; do not re-derive the verdicts by hand:
python3 skills/task-orphan-check/scripts/classify.py # add --workspace DIR to override
It prints one JSON object — tasks[] with id, source, access_tier, channel_id, label (the readable channel label step 3b uses), age_s, import (with import_intent; import_task_id — the task_id the current status.json carries, null when it has none; and for a bound or unbound run import_phase / import_idle_s), verdict (done / held / worker-held / unknown / fresh / orphan / import-resume / import-stalled / import-unbound; a worker-held row also carries holder, the recipient id) and a reason naming the marker, sentinel or age line it matched — plus counts. Read-only: it moves and writes nothing; step 3 acts on its verdicts. The rules it encodes are the ones below (pinned by tests/task-orphan-check-classify.test.py); if you change a rule, change the script and its test, then this prose.
For each file in tasks/, let <id> be the value of the id: header line (e.g. task-1779570142563). The file is tasks/<id>.txt. Per-task paths below use <id> consistently — note <id> already includes the task- prefix; do NOT add it again.
Next to this one in the catalogue, plus more from the same author.