Skip to content

fix(scheduler): Keep scheduled tasks out of threads - #1888

Merged
dcramer merged 3 commits into
mainfrom
fix/scheduled-automation-channel-destinations
Sep 21, 2026
Merged

dcramer merged 3 commits into
mainfrom
fix/scheduled-automation-channel-destinations

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Scheduled Automations must target Slack channels or direct messages, not threads.

This removes the destination: "channel" tool option because channel delivery is now the default. Migration 0043 removes threadTs from stored Automation Destinations and message outcomes. Reads also remove thread fields written by older workers during deployment.

via David Cramer.

--

View Junior Session [Sentry]

@vercel

vercel Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Sep 21, 2026 2:20pm UTC

Request Review

@dcramer
dcramer marked this pull request as ready for review September 21, 2026 14:29
@github-actions github-actions Bot added the risk: high PR risk score: high label Sep 21, 2026
@dcramer
dcramer merged commit 83fd9c5 into main Sep 21, 2026
43 checks passed
@dcramer
dcramer deleted the fix/scheduled-automation-channel-destinations branch September 21, 2026 14:32
dcramer added a commit that referenced this pull request Sep 22, 2026
Extends #1888 to event automations: deliver to channels or DMs, never
threads. Watches stay thread-bound.

Migration 0044 removes stored thread destinations. Reads also handle
rows written by older workers during deployment; new writes reject
thread fields. Already queued dispatches keep their original
destination.

<!-- junior-request-attribution:start -->
via **David Cramer**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1790114797.672819 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1790114797.672819)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1790114797.672819/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>
dcramer added a commit that referenced this pull request Oct 8, 2026
A scheduled automation run posted its report at the channel top level. A
PR Watch it created then posted "getsentry/yc-scraper#5 merged." as a
second top-level message instead of replying in the report's thread.

**Root cause**

Since #1888 and #1891, automation runs have a channel-level Location
with no thread. The run's first reply is bound to the Conversation, so
user replies in that thread already route back to it. Watch Turns
ignored that binding and posted to the channel again on every event.
Event-only Conversations had the same problem.

**Fix**

When a Turn's Slack Location has no thread, reply under the first Slack
Message bound to the Conversation in that channel. If nothing is bound
yet, the first reply still starts the thread.

**Known gap**

When a run's only output is a DM to its creator, Watch replies still go
to the channel the automation was created in. Tracked in #2014.

<!-- junior-request-attribution:start -->
via **David Cramer**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1791479373.496159 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1791479373.496159)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1791479373.496159/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 944e989a Deployed Sep 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant