ductor icon indicating copy to clipboard operation
ductor copied to clipboard

Heartbeat does not support group chats and topics

Open alexeymorozua opened this issue 8 months ago • 1 comments

Feature request

The heartbeat observer only iterates over allowed_user_ids (private chats). It does not send heartbeat checks to group chats, and there is no way to specify a topic_id for groups with forum topics enabled.

Current behavior

for chat_id in self._config.allowed_user_ids:
    await self._run_for_chat(chat_id)

Only personal chats receive heartbeat messages.

Expected behavior

Heartbeat should also iterate over allowed_group_ids and support sending to a specific topic within a group (via topic_id in HeartbeatConfig).

Suggested changes

  1. heartbeat/observer.py — include allowed_group_ids in the chat iteration
  2. config.py — add topic_id: int | None = None to HeartbeatConfig
  3. bus/adapters.py — pass topic_id through from_heartbeat()
  4. orchestrator/observers.py — route topic_id for group chats

alexeymorozua avatar Mar 12 '26 21:03 alexeymorozua

Implemented in v0.15.0. I added group_targets to HeartbeatConfig with full per-target overrides (prompt, ack_token, interval_minutes, quiet_start, quiet_end, enabled). Each target with a custom interval runs its own independent asyncio loop. Chat validation with 1h TTL cache, delivery fallback to main user on failure, and hot-reloadable start/stop.

PleasePrompto avatar Mar 14 '26 13:03 PleasePrompto