Repository navigation
fix(event-automations): Run events about one object in one conversation - #2084
Draft
sentry-junior[bot] wants to merge 10 commits into
Draft
sentry-junior[bot] wants to merge 10 commits into
sentry-junior[bot] wants to merge 10 commits into
Conversation
Event automations created one conversation per webhook delivery, so one opened pull request (#2081) fanned out to about 17 parallel runs and four duplicate reviews. Key each automation run by automation, destination, and Event object. GitHub repository copies of pull request and issue Events now carry objectIdentifier. Dispatches share that conversation, wait for the event burst window, and run pending dispatches as one Turn. A resumed Turn completes only the dispatches it recorded, so later events wait for the next Turn. Extend the agent test fixture so run() accepts a GitHub webhook burst and continue() delivers a later event to an automation conversation, and cover the #2081 scenario in the event automation delivery eval. Co-Authored-By: David Cramer <[email protected]>
Keep joined input in mailbox order, simplify the running transition, and drop diff noise. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
7 screenshot changes — 7 changed · 0 added · 0 removed Review screenshots in Frameshift |
Sentry Evalsjunior-behavioral
Base commit junior-guardian
Base commit junior-integration
Base commit junior-router
Base commit |
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/37864537548. The evals of this commit replay them in strict mode. Eval-Suite: behavioral
The GitHub plugin records pull request outcomes from opened webhooks and requires the id, merged, and updated_at fields that GitHub always sends.
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/37865558218. The evals of this commit replay them in strict mode. Eval-Suite: behavioral
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/37866615736. The evals of this commit replay them in strict mode. Eval-Suite: behavioral
Each event automation delivery waits for the event burst window, so three deliveries in one eval exceeded the 120 second eval timeout. Cover the burst and its later event in one eval, and separate pull requests in another.
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/37867847355. The evals of this commit replay them in strict mode. Eval-Suite: behavioral
The integration evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/37867847496. The evals of this commit replay them in strict mode. Eval-Suite: integration
1 of 13 tasks
This branch was successfully deployed
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.
Opening #2081 fired one repository-level event automation about 17 times. The events were
opened+ready_for_review, a Vercel comment, and onechecks.recoveredper passing check suite. Each delivery got its ownagent-dispatch:<id>conversation, so the runs went in parallel with no shared history. Four of them posted the same closing review.This change keys each automation run by automation + destination + Event object, so events about one PR share one conversation.
Runtime
EventInputgets an optionalobjectIdentifier. The GitHub plugin sets it to the PR or issue on the repository copies of PR and issue events, because those copies replaceidentifierwith the repo.ingestEventAutomationsgives each dispatch a fixedevent-automation:<hash>conversation id. It also delays the wake byEVENT_WAIT_MS, so a burst of events lands in one mailbox batch.joinedDispatchIds. When a Turn resumes after a redelivery, it completes only the dispatches it recorded. A dispatch that arrived after the Turn started stays in the mailbox and runs in the next Turn (deferred), so it is not dropped.Tests (agent test fixture)
run([githubWebhook(...), ...])sends a burst of deliveries and fails unless they start exactly one Conversation.conversation.continue(githubWebhook(...))delivers a later event to an automation Conversation and fails if that event starts another Conversation.evals/integration/coding/event-automations/delivery.eval.tsreplays the fix(performance): Optimize automations list collection query #2081 shape as signed webhooks: PR opened (which also sends ready-for-review), avercel[bot]comment, and three passing check suites. It expects one completed Turn and one reply (Update 1). A late check suite must continue the same Conversation and replyUpdate 2, which shows it saw the history. A second PR must get its own Conversation (Update 1).Not in this PR:
checks.recoveredstill fires for every successful check suite, not only when checks go from failing to passing. Those events now join the PR's conversation instead of starting new runs, but a late suite still wakes one more Turn. The fix needs earlier check state, so it comes in a separate PR.Verification
pnpm lintpasses, andtscpasses forjuniorandjunior-evals.junior-githubtests: 225 passed.juniorevent automation, events, and dispatch worker tests pass, exceptdelivers the current automation card…, which also fails onmain.juniorsuite had 14 failures. I reran the failing files onmain, and they fail there too.via David Cramer.
--
View Junior Session [Sentry]