fix(slackbot): read routed DM metadata payloads#22
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
include_all_metadatawhen Slackbot reads routed DM root messages.event_typeand falling through to a new agent handoff.Context
PR #21 wrote route information into Slack message metadata and expected approval replies like
post backto copy the latest successful Watch Agent result back to the original thread. In production, Slack returned only the metadataevent_typeunlessinclude_all_metadata=truewas set onconversations.replies, so the handler could not parse the route payload and ignored the approval.Observed on routed DM thread
D0B7DPBT69M/1783436525.851069: the replyok post that backwas handed to a new Watch Agent turn instead of posting to original threadC0BEAU4B66T/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.tsbun run check:typesbun 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.tsdocker build -t centaur-slackbot:latest -f services/slackbot/Dockerfile .Live diagnosis also confirmed that
conversations.replieswithoutinclude_all_metadatareturns only{ event_type }, while the same call withinclude_all_metadata=truereturns the fullevent_payloadcontaining the source channel and thread.