Task progress

From sonichi/sutando · View interactive version

Task progress is an AI agent skill from the GitHub repository sonichi/sutando. Sends mid-task progress updates to the channel a task came from (Slack, Discord, Telegram, or an s.space room).

How to use this skill

Skill file

task-progress

Sends mid-task progress updates to the channel a task came from (Slack, Discord, Telegram, or an s.space room).

Critical rule — if you notify, notify BEFORE any work begins

For tasks that need a progress update, **call notify.py as the FIRST action after reading

the task — before transcription, web searches, code reads, or any other tool call.**

The user's first signal that you received a long-running task must be the notification,

not silence followed by a result minutes later.

Critical rule — progress only, never final answers

notify.py is only for short progress/status updates. Do not use it to send the

answer, findings, recommendations, completed list, PR summary, or any other final result.

Final task delivery must go through the authoritative task result file

(results/task-<id>.txt, or the channel-specific result path named in the task).

Keep notify bodies short: at most 280 characters and 4 non-empty lines. The script

rejects longer messages so a final answer cannot accidentally be sent directly and

then duplicated by the bridge when it delivers the result file.

If you already sent the final answer through another approved path, write [REPLIED]

to the task result file so the bridge archives the task without sending a duplicate.

Voice message tasks (most common failure case)

When a task contains a voice attachment ([File attached: ...]), notify BEFORE calling the

transcription script. Transcription takes 10–30 seconds — the user should not wait in silence.

Wrong order:

  1. Read task (sees voice attachment)
  2. Call transcribe.py ← 20s of silence
  3. Process transcript
  4. Return result ← user waited 60+ seconds with no signal

Correct order:

  1. Read task (sees voice attachment)
  2. Notify: "Got your voice message, give me a moment." ← user knows within seconds
  3. Call transcribe.py
  4. Process — if research needed, notify again before starting
  5. Return result

All other long-running tasks

Wrong order:

  1. Read task
  2. Do research (WebSearch, WebFetch, file reads, analysis...)
  3. ← user waits 2 min with no signal
  4. Notify "on it"
  5. Return result

Correct order:

  1. Read task
  2. Notify immediately ← user knows you got it within seconds
  3. Do research / work
  4. Notify at key checkpoints
  5. Return result

When to notify

Notify at task-start when any of these apply:

No notification needed for:

When in doubt, notify. A false positive (notifying for a 30-second task) is far less

annoying than silence for 2 minutes on a research task.

How to use

Pass --task-file <path>. It derives --source, --channel-id/--chat-id,

--thread-root (from thread_root: only — threading is a decision the ask already made,

not this script's default), --reply-to (from source_message_id:, the asking message —

never reply_to_event:, the post the sender quoted; cites the ask without nesting it in a

thread the user never started) and --thread-ts (from Slack's reply_thread_ts:) straight

from that task file's own headers, so there is nothing left to extract or remember by hand.

When the ask was already in a thread, both fields are sent together: thread_root nests the

post, reply_to is its citation fallback for a client that doesn't render threads. A task

sends when its source is slack/discord/telegram, or — for ANY other source, known or

not — when its channel is a valid Matrix room id: strict !opaque:server, or a server-less

room v12 id (e.g. s.space, or a docked voice task). Everything else — undocked voice

(local-voice), chat, cron, runtime-api, onboarding-wizard, any non-room channel —

sends nothing and exits 3 (no delivery path; not a failure of the task), whatever channel

config exists. Accepted trade-off: gateway provider labels are install-configured, so routing

keys on the room id, not the source — a future writer that carries a real room id will send.

The verdict is src/progress_route.py. Call immediately after reading the task:

python3 $CLAUDE_CONFIG_DIR/skills/task-progress/scripts/notify.py \
  --task-file "$WORKSPACE/tasks/task-<id>.txt" \
  --message "On it — looking into that now. Back in a minute."

For research tasks, be specific about what you're doing:

  --message "Researching Trigify setup time now — back in a minute."

Mid-task checkpoint update — same --task-file, new message:

python3 $CLAUDE_CONFIG_DIR/skills/task-progress/scripts/notify.py \
  --task-file "$WORKSPACE/tasks/task-<id>.txt" \
  --message "Done with the research — writing up the summary now."

Any of --source / --channel-id / --chat-id / --thread-root / --reply-to / --thread-ts

given explicitly alongside --task-file still wins over what the file carries (e.g. to post a

checkpoint with no citation at all, pass --reply-to '').

When there is no task file to point at

Pass the fields by hand — same flags, same meaning:

python3 $CLAUDE_CONFIG_DIR/skills/task-progress/scripts/notify.py \
  --source slack \
  --channel-id D0B5L7X2TK2 \
  --message "On it — looking into that now. Back in a minute."

For a Slack @mention (threaded reply), add --thread-ts <ts> to keep the update in-thread.

For s.space, pass the task's own thread_root: via --thread-root '<event id>' only when

the ask was already in a thread; otherwise pass --reply-to '<source_message_id>' to cite it

in the main timeline instead. Single-quote the id: it starts with $, which double quotes

would expand. An empty value opts out of that relation.

Field mapping from task files

(What --task-file derives automatically; use this table only when passing fields by hand.)

| source | field in task file | CLI flag |

|-----------|---------------------|-----------------|

| slack | channel_id: | --channel-id |

| discord | channel_id: | --channel-id |

| telegram | chat_id: | --chat-id |

| ag2space | channel_id: | --channel-id |

Optional for Slack @mentions: reply_thread_ts: → --thread-ts.

Optional for s.space: thread_root: → --thread-root (only when the ask was already in a

thread); source_message_id: (the asking message — never reply_to_event:, the post the

sender quoted) → --reply-to, sent regardless so the update always cites what it's about.

s.space rooms

A task with source: ag2space is a message in an s.space room (its channel_id, !room:server).

The same script posts the update in that room:

python3 skills/task-progress/scripts/notify.py \
  --task-file "$WORKSPACE/tasks/task-<id>.txt" \
  --message "Got it, 2 in line before this one."

Any --source other than slack/discord/telegram is sent through the remote gateway

(channels/<source>/.env under $CLAUDE_CONFIG_DIR, REMOTE_TASK_URL + REMOTE_TASK_TOKEN), the

transport the s.space task bridge itself uses. The room the task came from is the only room this

posts to; a queue position ("Got it, right after the one I'm on." / "Got it, N in line before this

one.") is one line, in that task's own conversation.

Browser steps: show, don't narrate afterwards

When a task has you browsing (buying, booking, filling forms, searching a site), the

person wants to see each step as it happens, not a summary at the end. Use step.py:

one short line plus a screenshot of the page.

# The live page: a screenshot the session doing the work took of the page it is on.
python3 $CLAUDE_CONFIG_DIR/skills/task-progress/scripts/step.py \
  --source ag2space --channel-id '!owner-dm:server' \
  --message "Checkout page — 2 items, $84.10, shipping to the home address. OK to pay?" \
  --screenshot /path/to/shot.png
# A fresh load of a public page (a listing, a search result), never an approval:
  --message "Searching flights" --capture "https://flights.example/search?q=..."

Where the steps go. The same audience rule as any reply (CLAUDE.md "Where replies

go"): a browsing errand the owner asked for themselves — a purchase, a booking, a search

on their behalf — and anything read from their logged-in accounts (cart, prices, addresses,

order details) go to the owner DM, even when the task arrived in a shared room or by

voice while docked in one. --channel-id is then the owner's DM room: the task's

channel_id when it came from the DM; for a task from a shared room, the owner_dm

reading in <workspace>/state/owner-routing.json (the bridge's own reading, the room

proactive messages go to). Post exactly one line in the room — "I'm on it; the steps are

in our DM." — and nothing else there. Steps go in the room only when the room itself asked

for the work and the pages hold nothing from the owner's accounts.

The approval screenshot is the live page, taken by the session doing the work. Post a

step after every navigation, form fill and page-changing click, and **always before a

purchase, payment, booking or form submit**; then wait for the owner's go-ahead in that

conversation before you pay or submit.

the same action chain as the fills — end the chain with screenshot before the

submitting click (fill:… click:#review screenshot), post the path it prints, and run

the submit as its own later command after the go-ahead.

(skills/macos-tools screen capture, or the screenshot: path the macos-use traversal

prints), copied into the screenshot dir below, then --screenshot <path>.

browser profile (logged-in cookies apply, in-page state does not — a filled form, a

selected shipping option, an SPA cart are gone) and a second GET of the page. It is for a

public page or a listing; step.py says on stderr when a picture was a fresh load.

The text line follows the same rule as notify.py (280 chars, 4 lines); the image goes

through the gateway's room media route, so this works for s.space rooms (any gateway

--source), and Slack/Discord/Telegram get the text line only. Screenshots must sit in

src/browser.mjs's screenshot dir ($SUTANDO_SCREENSHOT_DIR, default

<tmpdir>/sutando-screenshots) or under the [file:] allowlist (results/,

/tmp/sutando-*); anything else is refused and the line still lands. A failed screenshot

never blocks the task.

Supported channels

All three share one resolver (src/channel_token.resolve_channel_token), the same one the bridges

use, so a token stored only via vault set resolves here too. If src/ is not importable the

vault tier is skipped rather than raising — a progress notification never fails a task.

Discord mentions

Discord mention validation is on by default. Use a resolved user snowflake

(<@USER_ID>), not a GitHub-style @handle. Before posting, notify.py

checks each user ID through Discord; after posting, it verifies the response's

mentions array. An unresolved mention exits 1 with an agent-visible error.

For intentional plain-text handles that should not ping anyone, pass

--no-validate-mentions.

Fail-open

A failed send (missing token, network error) prints a warning to stderr and exits 1.

A task with no delivery path sends nothing and exits 3, so a caller never reads it as delivered.

Always continue working on the task regardless of exit code. The notification is

best-effort — task delivery via the result file is the authoritative path.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.