Task Recovery logo

Task Recovery

Organization
sonilo-ai
task-recovery

Recover the result of a timed-out Sonilo generation call using its task_id. Use whenever text_to_sfx, video_to_sfx, video_to_video_music, video_to_video_sfx, video_to_sound, video_to_video_sound, audio_ducking, dubbing, proofread, analyze_video, or video_to_music(preserve_speech=true) times out or its call was interrupted — the generation already ran (and was already charged) and its result is still retrievable.

Overview

Publishersonilo-ai
Repositoryskills
Skill nametask-recovery
Stars
117
Forks
9
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by sonilo-ai on GitHub. Read the source before you install it.

Installation

Install the Task Recovery AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/sonilo-ai/skills/tree/main/task-recovery
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sonilo-ai/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/task-recovery .claude/skills/task-recovery
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Task Recovery in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Task Recovery on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Task Recovery is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Sonilo Task Recovery

Every Sonilo generation that runs asynchronously on the backend (SFX, ducking, video-to-video, video-to-sound, dubbing, proofread, video-analysis, and video_to_music(preserve_speech=true)) is already charged the moment it's accepted — a client-side timeout does not stop it or refund it. This tool checks a task's status and, once finished, downloads its result. It never itself charges anything.

Setup: See the setup-api-key skill.

This tool is a safety net, not something to call speculatively. Only use it when you actually have a task_id — from a timeout error message, or from the [sonilo-mcp] task submitted: <id> line a host prints to stderr the moment a task is submitted (this survives even a cancelled call).

Transport: MCP or CLI

Pick one at the start of the session and stay on it. Do not mix the two inside a single job, and do not announce the choice.

  1. Sonilo MCP tools visible in this session (get_sfx_task and friends) — use them. This is the preferred path: it needs no shell, and it is the only one that survives a very long generation. If a call fails to authenticate — rather than failing on its inputs — this transport is not usable in this session: go to 2 instead of retrying it.
  2. No usable Sonilo MCP tools, but sonilo account exits 0 — use the CLI commands below. Same API, same account, same credential file. Probe with sonilo account, not sonilo whoami: whoami exits 0 even when signed out, so it cannot tell the two states apart.
  3. Neither — stop and run the setup-api-key skill. Do not call api.sonilo.com with curl to work around it; both transports handle uploads, polling and retries that a bare request does not.

Quick Start

MCP tool call (recommended)

get_sfx_task(task_id="a1b2c3d4-...")

The tool has two names. The local sonilo-mcp server calls it get_sfx_task; the hosted OAuth server (the sonilo-claude-plugin path) calls it get_generation_task(task_id). Same job, same arguments — call whichever one the connected server actually exposes rather than assuming, since only one of the two exists in any given session.

Python (pip install sonilo)

python
from sonilo import Sonilo

client = Sonilo()  # reads SONILO_API_KEY

status = client.tasks.get("a1b2c3d4-...")   # single check, never raises on failure
result = client.tasks.wait("a1b2c3d4-...")  # polls until terminal; raises TaskFailedError/TaskTimeoutError
result.save("recovered.wav")

tasks.get/tasks.wait default to parsing an SFX-shaped result. For a task from dubbing, video_to_sound/video_to_video_sound, analyze_video, or async video_to_music, pass the matching parser explicitly (from sonilo.resources.tasks import parse_music_result, parse_sound_result, parse_dubbing_result, parse_video_analysis_result) — see sonilo-python's README for the exact call shape per task type.

JavaScript / TypeScript (npm install sonilo)

ts
import { SoniloClient } from "sonilo";

const client = new SoniloClient(); // reads SONILO_API_KEY

const status = await client.tasks.get("a1b2c3d4-...");   // single check
const result = await client.tasks.wait("a1b2c3d4-...", { pollInterval: 2000 }); // waits up to 45 min by default

Same caveat as Python: pass the task's actual result type as wait<T>()'s generic (e.g. wait<MusicTaskResult>(...)) for a non-SFX task — see sonilo-js's README.

CLI (npm install -g sonilo-cli or pip install sonilo-cli)

bash
sonilo tasks get a1b2c3d4-...

# npm's sonilo-cli: --poll-interval/--timeout are milliseconds
sonilo tasks wait a1b2c3d4-... --poll-interval 2000 --timeout 2700000

# pip's sonilo-cli: the same flags are seconds
sonilo tasks wait a1b2c3d4-... --poll-interval 2 --timeout 2700

The two sonilo-cli packages (npm and pip) aren't the same codebase — double-check which one is installed before assuming a flag's units.

cURL (raw REST API, no MCP host)

bash
curl "https://api.sonilo.com/v1/tasks/a1b2c3d4-..." \
  -H "Authorization: Bearer $SONILO_API_KEY"

The MCP tool does one status check and, if status is terminal, downloads and saves the resulting file(s) for you — it does not poll in a loop.

Tool

ToolDescription
get_sfx_task(task_id, output_directory?)Check a task; if it succeeded, download and save its result file(s).

Behavior by Status

StatusWhat happens
processingReturns a "still processing, try again later" message. No file saved. Call again after a short wait.
succeededDownloads and saves the result — audio for text_to_sfx/video_to_sfx; a single .wav or .mp4 for audio_ducking; a single .mp4 for video_to_video_music/video_to_video_sfx/video_to_video_sound; a single .wav for video_to_sound; one .mp4 per language for dubbing, plus one .srt beside each when the call asked for re-timed subtitles (export_srt) — a language whose export was blocked still gets its video and is reported as a note, never a failure; one .srt per language for proofread, always including the detected source language, followed by that language and the source script's cue count; for a video_to_music(preserve_speech=true) task, the music stream(s) plus the vocals stem plus the mux. An analyze_video task is the exception: it has no file at all, so the creative brief comes back inline as JSON and nothing is written to disk.
failedRaises an error including the backend's error code/message and whether the charge was refunded — check this before telling the user they've been billed for nothing.
task id not found (404)The id is wrong/typo'd, or belongs to a purely streaming call (text_to_music in its default streaming form — no wav, no variants_num above 1, no stems — or video_to_music without preserve_speech/ducking/stems/output_format="wav") — those have no task at all and can't be recovered this way. Nothing to retry.
any other status (not processing/succeeded/failed)Raised as an "unexpected task status" error naming the task id. Treat as transient — this is a backend state this tool doesn't otherwise special-case — and call get_sfx_task(task_id) again shortly.

Workflow Tips

  • Safe to call repeatedly. If a result was already downloaded to disk, a later call reports "Already downloaded" instead of re-fetching a duplicate copy — you won't accumulate -1/-2 suffixed files from checking twice.
  • Don't confuse this with get_account_services/get_usage (the account skill) — this tool is about recovering one specific generation's output, not account-level info.
  • If a failed task shows refunded: false, point the user at get_usage to reconcile billing, and note the charge stands.
  • output_directory defaults to SONILO_MCP_BASE_PATH, same as every generation tool — pass the same directory you'd have used for the original call if you want the recovered file alongside other output.

Error Handling

A transient failure while checking (e.g. backend 5xx) does not mean the result is lost — re-run get_sfx_task(task_id) shortly after. A 401/402 here means the check failed (key rotated, account suspended) — the task itself was already charged and its result is still on the backend; resolve the auth/billing issue, then call get_sfx_task again.

Frequently asked questions

What does the Task Recovery AI skill do?

Recover the result of a timed-out Sonilo generation call using its task_id. Use whenever text_to_sfx, video_to_sfx, video_to_video_music, video_to_video_sfx, video_to_sound, video_to_video_sound, audio_ducking, dubbing, proofread, analyze_video, or video_to_music(preserve_speech=true) times out or its call was interrupted — the generation already ran (and was already charged) and its result is still retrievable.

Why use Task Recovery on TypingMind?

Because you install it once and use it with any model. Task Recovery is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Task Recovery in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/sonilo-ai/skills/tree/main/task-recovery. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Task Recovery?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Task Recovery?

As many as you like. As long as a model supports skills, you can use Task Recovery with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Task Recovery AI skill free?

Yes. It is published on GitHub by sonilo-ai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇