feat(hn-monitor): reply over the relay to the sender (consume #254 platform)
Merged
KH
5mo ago+211+211+012345678901234567890123456789-39-39-01234567890123456789
The agents-repo consumption (D) of the platform relay-reply work (workforce#254 / #255 / #256). Makes hn-monitor answer a relay DM over the relay, back to whoever asked, instead of always posting to Slack.
What
- Bump
@agentworkforce/{delivery,runtime,persona-kit}→^4.1.14(published relaycast target +ctx.relay). - hn-monitor relay Q&A branch:
- Resolve the inbound sender from the event summary
actor(the cloud envelope-builder normalizes the relaycastfrom→summary.actor), defensively probingevent.summary/expand('summary')/ full payload. - When resolved →
ctx.relay.dm(sender, answer)(true A2A round-trip); otherwise fall back to the existing Slack/Telegram delivery (no regression). Never throws.
- Resolve the inbound sender from the event summary
- Fix two pre-existing narrowings now that delivery's
MessageRef/targetsincluderelaycast(filter toslack|telegramin the fallback target list +saveHeaderRefs).
Tests
- New: A2A round-trip (sender resolved →
ctx.relay.dmcalled, Slack skipped). - Existing relay test (no sender → Slack fallback) still green.
- 167/167,
tsc --noEmitclean.
Notes / sequencing
- Safe to merge on its own — graceful Slack fallback means no behavior regression if the sender can't be resolved.
- The full prod round-trip also needs the gateway/key cutover (cloud#2501 →
cast.agentrelay.com+ re-mint keys) and relay-on-default (cloud#2491, merged) + recipient-scoping (cloud#2494, merged). - The
summary.actorfield path is verified against the test harness; worth a final confirm against the live relay — the resolver degrades gracefully if it differs.
Refs AgentWorkforce/workforce#254
🤖 Generated with Claude Code
Summary by cubic
hn-monitor now replies to relay DMs over the relay directly to the sender (agent-to-agent), instead of always posting to Slack. Upgrades @agentworkforce/{delivery,runtime,persona-kit} to ^4.1.14 to enable relaycast and ctx.relay, aligning with workforce#254.
-
New Features
- Resolve inbound sender from
summary.actor, also probing expandedsummaryand the full payload. - When found, reply via
ctx.relay.dm(sender, answer); otherwise fall back to Slack/Telegram.
- Resolve inbound sender from
-
Bug Fixes
- Guard the relay-reply path behind
ctx.relayand reuse the already-expanded payload (no redundantexpand). - Filter fallback delivery to only
slack/telegramand limitsaveHeaderRefsto those refs.
- Guard the relay-reply path behind