feat(hn-monitor): unify Slack + Telegram into single dual-transport agent
Merged
KH
4mo ago+2+2+0123456789-515-515-012345678901234567890123456789
Summary
Replaces the separate hn-monitor and hn-monitor-telegram agents with a single dual-transport agent. Delivers to Slack, Telegram, or both — configuration-driven via SLACK_CHANNEL and TELEGRAM_CHAT inputs (both optional).
Depends on workforce#250 for @agentworkforce/delivery (now published as ^0.1.0).
Changes
- Single agent.ts — uses
createDeliveryfrom@agentworkforce/delivery, auto-detects configured transports - Non-blocking parentRef threading — header published with 0ms timeout, body threaded via parentRef (x-reply-radar pattern, zero receipt round-trips)
- Backported Telegram improvements:
fetchWithTimeout(8s AbortController),withTimeoutfor LLM, pending thread body recovery withheaderRefsfor proper retry threading - Shared helpers (
input,list,withTimeout,fetchWithTimeout) from@agentworkforce/delivery - Persona declares both
slackandtelegramintegrations, both inputsoptional: true - Q&A routes relay inbox DMs and Telegram messages through shared handler, replies only to origin transport
- Recovery tests verify pending body retry preserves threading context
- Removed
hn-monitor-telegram/directory (now superseded) - 161/161 tests pass, typecheck clean
Summary by cubic
Unifies the Slack and Telegram HN monitors into one agent that posts to Slack, Telegram, or both via @agentworkforce/delivery. Adds non-blocking threading with robust recovery and prevents cross-post or partial-publish failures.
-
New Features
- Config via
SLACK_CHANNELandTELEGRAM_CHAT(optional) with unified, non-blocking parentRef threading; addsfetchWithTimeout(8s) andwithTimeoutto prevent hangs. - Durable recovery: saves
headerRefsand retries threaded bodies on the next scan; unified Q&A for relay DMs and Telegram, replying only on the origin transport.
- Config via
-
Bug Fixes
- Treats partial header publishes as failures; builds pending state before sending the body; clears orphaned pending bodies when targets change; fixes cross-post leakage with transport-scoped delivery.
- Removes
hn-monitor-telegram/and superseded Telegram tests; updates imports; uses published@agentworkforce/delivery@^0.1.0(matchesmain).