Repository navigation
fix(slack): Resolve one Slack target for every visible Turn post - #2461
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
rebase this and remove the requirement of a phd to understand what the changes is in the pr description |
a158621 to
02504cd
Compare
Add resolveSlackReplyTarget in slack/reply.ts. It picks the channel from the Destination and the thread from the Turn Source, then the Conversation Location, then the Destination. It never parses the Conversation id. Route stranded-turn failures, resume notices and failures, ingress error fallbacks, auth-pause and config replies, and the automated-turn-limit notice through sendSlackReply, so each post has the Conversation footer. Add ast-grep rules that forbid raw Slack posts and parseSlackThreadId outside an explicit allow list.
Add postsRunNotices next to finishedRunReply. A chat Turn may post a failure reply or status notice. An Automation run and a dispatch with no outcomes post nothing. Apply it to the stranded-turn failure, the resume failure reply, and the resume and auth-pause notices. The stranded-turn failure now records the dispatch outcome from the dispatch record, because a dispatch Conversation has no session Source and its routing lookup fails.
02504cd to
bf338de
Compare
|
i still think longer term this should be somewhat implicit. so like we bind context that dictates where slack messages go, and nothing has to think about it |
|
2 screenshot changes — 2 changed · 0 added · 0 removed Review screenshots in Frameshift
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bf338de. Configure here.
| text, | ||
| threadTs: resume.threadTs, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Resume failures ignore automation silence
Medium Severity
postRunNotice decides whether to stay quiet from resume.run?.dispatch. run is only attached after beforeStart succeeds, so a setup failure rethrown from beforeStart still posts a Slack error for an Automation or no-output dispatch. That path was meant to stay silent and only record the failure on the Turn and Automation.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit bf338de. Configure here.
The decision model never flagged a file list, even on the #2461 draft. It did reject a reviewed body for a note about missing test coverage. The #2461 final still reports local check results, so it is now a reject case, and the #3204 naming case is gone: the model does not read a naming rationale as a work log. Co-Authored-By: David Cramer <[email protected]>
Agent-written PR descriptions often carry what reviewers do not need: check results, test plans and coverage notes, the work log, and talk about the request. Sometimes they also leave out why the change is needed. Reviewers pushed back on this on #2420, #2461, #2668, and others. With `githubPlugin({ experimental: { pullRequestDescriptionChecks: true } })`, `createPullRequest` and `updatePullRequest` check the `body` before the GitHub write. The decision model (`ctx.decider`) answers 4 yes/no questions in parallel. Any yes rejects the call with a `PluginToolInputError` that lists the fixes, so the agent sends a better body. The experiment is off by default, and the tool input does not change. This adds `decider` to the plugin tool context in `@sentry/junior-plugin-api`. Before, only `afterToolExecute` had it. The classifiers suite has a new eval file. It uses first drafts and reviewed finals of junior PRs, plus a few short made-up bodies. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0AHB7N2JCR%3A1794434761.838699 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0AHB7N2JCR%3A1794434761.838699) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0AHB7N2JCR%3A1794434761.838699/?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]> Co-authored-by: David Cramer <[email protected]>


Stacked on #2458. Merge that first, then retarget this PR to
main.What was wrong
agent-dispatch:watch-1) are not Slack thread ids.What this changes
resolveSlackReplyTargetinslack/reply.tspicks the channel and thread. Every Turn post (replies, error messages, auth notices) now goes through it andsendSlackReply, so each post lands in the right thread and has the footer.requestUserInputbuttons.A side fix: when a stuck Automation run was failed, its dispatch stayed
running. It is now markedfailed.Not changed
Plugin dispatches (
ctx.agent.dispatch) keep their current behavior. They post their result to the destination they give.Tests
durable-queue.test.ts: a failed reply in a Watch thread is posted in that thread, with the footer.agent-dispatch-work.test.ts: an Automation with no outputs that fails posts nothing to Slack.event-automationshas one failure that also happens on the base branch.--
View Session [Sentry]