fix: route Slack mention triggers via message.created, not app_mention
Merged
KH
3mo ago+28+28+01234567890123456789-11-11-01234567890123456789
Summary
- hn-monitor and inbox-buddy both declared their Slack trigger as
{ on: 'app_mention' }. Live-traced viawrangler tail cloud-web-workerwhile reproducing the reported "hn-monitor didn't answer a Slack mention" bug: the mention arrived at the webhook as a plainmessage.createdevent, and cloud'srelayfileTriggerMatchesEventhard-excludesapp_mentionfrom generic resource matching — it can only ever match a literalapp_mentioneventType, which never actually arrives for thread replies. Dispatch logs confirmed"Integration watch dispatch matched no agents"for every mention. - Switched both personas to
on: 'message.created'+ channel-scopedpaths+match: '@mention', the pattern already used in production byjoke-botandreview-agent(pr-reviewer). - Updated the one inbox-buddy test that asserted the old (broken) trigger shape.
Test plan
-
npm run test:hn— 29/29 pass -
node scripts/test.mjs tests/inbox-buddy.test.mjs— 19/19 pass -
npm test(full suite) — 188/188 pass -
npm run typecheck— clean -
agentworkforce persona compilefor both personas — clean, no persona.json diff - Redeploy hn-monitor/inbox-buddy and confirm a live Slack mention gets answered
🤖 Generated with Claude Code
Summary by cubic
Fixes missed Slack mention replies by routing hn-monitor and inbox-buddy via message.created with a channel-scoped path and @mention gate, instead of app_mention. Mentions in threads now dispatch to the agents reliably.
- Bug Fixes
- Updated Slack triggers to
on: 'message.created'withpaths: ['/slack/channels/${SLACK_CHANNEL}/**']andmatch: '@mention'. - Adjusted
inbox-buddytest to assert the new trigger shape. - Added inline comments clarifying
${SLACK_CHANNEL}is persona-kit deploy-time substitution, not JS template interpolation.
- Updated Slack triggers to