Skip to content

fix(slackbot): read routed DM metadata payloads#22

Merged
samuelclay merged 2 commits into
mainfrom
sam/routed-dm-full-metadata
Jul 7, 2026
Merged

fix(slackbot): read routed DM metadata payloads#22
samuelclay merged 2 commits into
mainfrom
sam/routed-dm-full-metadata

Conversation

@samuelclay

Copy link
Copy Markdown
Collaborator

Summary

  • Request include_all_metadata when Slackbot reads routed DM root messages.
  • This lets the approval handler recover the original channel/thread payload instead of seeing only event_type and falling through to a new agent handoff.
  • Add a regression assertion covering the Slack metadata payload flag.

Context

PR #21 wrote route information into Slack message metadata and expected approval replies like post back to copy the latest successful Watch Agent result back to the original thread. In production, Slack returned only the metadata event_type unless include_all_metadata=true was set on conversations.replies, so the handler could not parse the route payload and ignored the approval.

Observed on routed DM thread D0B7DPBT69M / 1783436525.851069: the reply ok post that back was handed to a new Watch Agent turn instead of posting to original thread C0BEAU4B66T / 1783436286.363169.

Test plan

  • bun test src/slack/thread-routing.test.ts src/index.test.ts src/centaur/handoff.test.ts src/centaur/final-delivery.test.ts
  • bun run check:types
  • bun test src/centaur/handoff.test.ts src/slack/normalize.test.ts src/slack/home.test.ts src/index.test.ts src/centaur/final-delivery.test.ts
  • docker build -t centaur-slackbot:latest -f services/slackbot/Dockerfile .

Live diagnosis also confirmed that conversations.replies without include_all_metadata returns only { event_type }, while the same call with include_all_metadata=true returns the full event_payload containing the source channel and thread.

@samuelclay samuelclay marked this pull request as ready for review July 7, 2026 15:43
@samuelclay samuelclay merged commit 70fac46 into main Jul 7, 2026
8 checks passed
@samuelclay samuelclay deleted the sam/routed-dm-full-metadata branch July 7, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant