agentscope-ai / agentscope-ai/QwenPaw
[Feature]: Add ntfy channel support (working implementation ready)
- 主要語言
- Python
- 星號
- 34.9k
- 分支
- 3.1k
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 225
描述
## 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.
貢獻指南
評估
這個 Issue 還沒有評估資料。