← Back to Plugins
Channels

Telegram Task Silencer

adagues By adagues 👁 56 views ▲ 0 votes

OpenClaw plugin that silences 'Background task done/...' notifications on Telegram only, without touching the task registry.

GitHub

Install

openclaw plugins install ./openclaw-telegram-task-silencer

Configuration Example

api.on("message_sending", async (event, ctx) => {
  if (!isTelegramChannel(event, ctx)) return;           // wrong channel → pass-through
  if (!isTaskTerminalMessage(event?.content)) return;   // not a task notif → pass-through
  return { cancel: true };                              // drop this message only
});

README

# openclaw-telegram-task-silencer

A tiny [OpenClaw](https://openclaw.ai) plugin that suppresses the
`Background task done: …` notifications on the **Telegram channel only**.

## Why

When you spawn ACP or subagent background tasks bound to a Telegram thread
(e.g. via `openclaw acp spawn`, thread bindings, or the built-in task
registry), OpenClaw auto-delivers a terminal notification to the thread when
each task finishes:

```
Background task done: kiro-identity-test4 (run 3970).
Background task blocked: …
Background task failed: …
…
```

These are noisy when you use ACP sessions heavily from Telegram. This plugin
drops those specific outbound messages on the Telegram channel and only those.

## What it does (and doesn’t do)

- ✅ Intercepts the Telegram outbound via the `message_sending` hook and
  returns `{ cancel: true }` for messages whose content starts with a known
  task-terminal prefix.
- ✅ Leaves every other Telegram message untouched (pass-through).
- ✅ Leaves the task registry untouched: tasks still run, still reach their
  terminal state, still update `deliveryStatus`, still dispatch in-session
  mirrors, still power `openclaw tasks list`. Only the Telegram
  notification line is swallowed.
- ❌ Does not modify ACPx, the task registry bundle, or any OpenClaw
  internals. No monkey-patching, no policy flipping, no cron.

## Supported prefixes

The plugin drops outbound Telegram messages that start with any of:

- `Background task done:`
- `Background task blocked:`
- `Background task failed:`
- `Background task timed out:`
- `Background task cancelled:`
- `Background task lost:`
- `Task needs follow-up:`

These are the exact strings emitted by OpenClaw’s
`formatTaskTerminalMessage` / `formatTaskBlockedFollowupMessage`
(`dist/task-registry-*.js`).

## Install

### From a local clone

```bash
git clone https://github.com/adagues/openclaw-telegram-task-silencer.git
openclaw plugins install ./openclaw-telegram-task-silencer
# restart the OpenClaw gateway for plugins to load
```

### Uninstall

```bash
openclaw plugins uninstall telegram-task-silencer
```

## How it works

OpenClaw exposes a `message_sending` hook (see
`dist/extensions/telegram/delivery-*.js`) that runs right before each
outbound Telegram message is delivered. The plugin registers a single
handler:

```js
api.on("message_sending", async (event, ctx) => {
  if (!isTelegramChannel(event, ctx)) return;           // wrong channel → pass-through
  if (!isTaskTerminalMessage(event?.content)) return;   // not a task notif → pass-through
  return { cancel: true };                              // drop this message only
});
```

That’s the whole plugin.

## Compatibility

- Tested against OpenClaw `2026.4.29` / CLI `2026.4.22`.
- Relies on the public plugin SDK (`openclaw/plugin-sdk/plugin-entry`) and
  the `message_sending` hook, both documented surfaces.
- If OpenClaw ever changes the terminal message wording, the prefix list
  in `index.js` needs an update.

## License

MIT — see [LICENSE](./LICENSE).
channels

Comments

Sign in to leave a comment

Loading comments...