agentscope-ai / agentscope-ai/QwenPaw

[Feature]: Add ntfy channel support (working implementation ready)

オープン
#7,657 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
TypeScript
スター
35k
フォーク
3.1k
平均マージ
1日 13時間
マージ済み PR(30日)
228

説明

## Summary

I'd like to propose adding [ntfy](https://ntfy.sh) as a built-in channel.
ntfy is one of the most popular self-hosted push services (~34k ★) and is a
natural fit for QwenPaw's home-lab / self-hosted user base: agents can push
task results to your phone and receive commands back through the same
infra.

I have already built and verified a working channel plugin:

- Repository: https://github.com/Mcpy/qwenpaw-ntfy-channel
- Install: `qwenpaw plugin install https://github.com/Mcpy/qwenpaw-ntfy-channel`
- Tested end-to-end against a self-hosted ntfy v2.28 server (publish,
JSON-stream subscribe, reconnect, chunking, loop prevention).

## Motivation

- The roadmap lists "More channels" as horizontal expansion seeking
contributors — this fits.
- ntfy's model (plain HTTP publish + long-poll JSON/SSE/WebSocket subscribe,
optional auth tokens and per-topic ACL) maps cleanly onto QwenPaw's
channel abstraction; no heavy SDK, only `httpx`.
- Self-hosters commonly run ntfy alongside services like Home Assistant,
Uptime Kuma, Sonarr — an agent that can both *push status* and *receive
commands* through it closes the loop for the whole homelab.

## Feature highlights (already working)

- **Three runtime modes via config**: bidirectional, outbound-only (cron /
scheduled pushes), inbound-only (`enable_outbound=false`, zero egress).
- **Separated reply routing**: replies are broadcast to configured
`push_topics` only — never back to the source topic. Users can freely
choose "reply where asked" (same topics) or "command/result channel
split" (different topics).
- **Loop prevention via the official `Tags` field**: outbound messages carry
a configurable `bot_tag`; inbound messages with that tag are dropped.
This survives reconnect replays (`since=`) and never misfilters
human-typed messages. Per-agent tags also make multiple agents sharing
one ntfy server safe.
- **UTF-8 byte-safe chunking** with newline-preferred breaks — CJK
(3 bytes/char) and 4-byte emoji survive the 4KB message limit intact.
- **Resumable subscription**: JSON stream with `since=` and
exponential backoff reconnect.
- **Access control**: topic-granularity, reuses QwenPaw's built-in ACL
whitelist/approval flow.

## Plugin → built-in readiness

If maintainers are open to it, I'm happy to contribute this as a built-in
channel and handle:

- package-relative imports + a pydantic config class (modeled after
`MQTTChannelConfig`) + registry registration
- pytest unit tests (chunking, loop prevention, routing, reconnect logic)
- docs under `website/public/docs/`
- Conventional Commits / pre-commit compliance

One side observation from development: after a plugin hot-install, calling
`POST /config/channels/{name}/restart` rebuilds the channel via
`channel_instance.clone()` — so the restarted instance still runs the *old*
code; only an agent-level reload picks up changes from the registry. This
may be related to #4498 and might be worth a look.

Happy to hear feedback on the design (especially the reply-routing model)
before starting the built-in refactor.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start from the existing built-in channel implementations and registry wiring, especially the pattern around `MQTTChannelConfig`, to add ntfy as a registered channel. Review `website/public/docs/` to add/update user-facing docs for the new channel and its modes. Add pytest coverage for chunking, loop prevention, routing, and reconnect logic, then run the relevant test path for channels. Validate behavior through the `/config/channels/{name}/restart` flow mentioned in the report; done when the built-in ntfy path is documented, tested, and behaves as described.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
backend
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
67/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。