feat: Configurable notification routing for startup and upgrade events
Problem
Currently, startup notifications (startup.py) use notify_all to broadcast to every allowed user, and upgrade notifications (upgrade_handler.py) use bot.broadcast. This means in a multi-user or group setup, all users receive every system notification.
For users running Ductor in a group with topics (e.g. a "Server" topic for infrastructure alerts), there is no way to route these notifications to a specific chat/topic without patching the source.
Proposed solution
Add optional config keys to control where startup and upgrade notifications are sent:
"notifications": {
"chat_id": -1001234567890,
"topic_id": 68
}
Behavior:
- If
notifications.chat_idis set → send startup/upgrade notifications there (with optionaltopic_id) - If not set → fall back to current behavior (
notify_all/broadcast) - Only send from the
mainagent in multi-agent setups (avoid duplicate notifications)
Why this matters
Anyone running Ductor in a group with topics wants system alerts in a dedicated channel, not scattered across all DMs and group chats. This is currently only achievable by patching startup.py and upgrade_handler.py directly — which breaks on every upgrade.
Shipped in v0.16.0.
Startup + upgrade notifications now honor group_targets the same way heartbeat already did. Added notifications.startup_targets and notifications.upgrade_targets to the config — each entry takes chat_id, topic_id, and enabled. Matrix parity too, so startup notices land in configured Matrix rooms. Thanks for flagging this, the routing logic was already half-there for heartbeat and just needed to be extended.