fix(channels): stop dropping every top-level Slack message - #6071
fix(channels): stop dropping every top-level Slack message#6071mmabrouk wants to merge 1 commit into
Conversation
Slack puts thread_ts only on messages inside a thread; a top-level message has none. The THREAD key composition declares thread_ts required, so every plain channel message raised ChannelLocatorIncomplete in the dispatch worker. Slack showed nothing, with no error anywhere the operator can see. parse_event now falls back to the message's own ts, which is Slack's own threading model: a top-level message roots the thread its replies live in (a reply's thread_ts IS the parent's ts). This also makes the agent's answer land as a thread reply under the mention it answers. The one existing test that pinned the old shape asserted a locator the rest of the system could not consume; it now pins the new semantics: a parent and the replies threaded under it resolve to one unit.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Railway Preview Environment
|
Context
Mentioning the bot with a plain, top-level channel message produced nothing in Slack: no reply, no error. The dispatch worker crashed on every such message with
ChannelLocatorIncomplete: Locator for slack is missing declared thread key field: thread_ts. Slack only putsthread_tson messages inside a thread; a top-level message has none, and the THREAD key composition declares the field required. Only messages typed inside an existing thread ever worked.Changes
parse_eventnow falls back to the message's owntswhenthread_tsis absent. This is Slack's own threading model: a top-level message roots the thread its replies live in, and a reply'sthread_tsis the parent'sts. It also means the agent's answer lands as a thread reply under the mention it answers.Before:
{"team": "T1", "channel": "C1"}(no thread key, dispatch raises)After:
{"team": "T1", "channel": "C1", "thread_ts": "<the message's own ts>"}One existing test pinned the old shape (
thread_tsabsent on a top-level message). That shape was one the rest of the system could not consume. The test now pins the new semantics: a parent and the replies threaded under it resolve to one unit.Tests
thread_ts.