Repository navigation
feat(plugins): Apply annotation and Inbox item changes in one write - #4096
Merged
Merged
Conversation
Add ctx.conversationChanges.apply to heartbeat and route contexts. Core saves a batch of annotation upserts and Inbox item closes in one transaction, then shows the closed items. A batch has at most 100 entries. The GitHub plugin now marks the chips of an ended pull request and closes its next-action item and merge conflict notice in one batch, from the webhook and the daily reconcile. Refs #3782 Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
6 screenshot changes — 6 changed · 0 added · 0 removed Review screenshots in Frameshift |
A stale linked Conversation id made the chip upsert fail and rolled back every chip and ask of an ended pull request. Batch only the chip of the Conversation that owns the asks with their closes. Each other linked Conversation gets its chip in its own write, so a stale id breaks only its own chip.
BYK
approved these changes
Nov 23, 2026
BYK
enabled auto-merge (squash)
November 23, 2026 15:03
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 c4f0f63. Configure here.
BYK
added a commit
that referenced
this pull request
Nov 23, 2026
Follow-up to #4096. When a pull request merged or closed, `applyGitHubPullRequestOutcome` read the Conversation that owns its asks after it wrote the outcome row. If that read failed, the error was only logged. Every linked chip then turned `merged` or `closed` while the asks stayed open. Because the row was already recorded, neither a redelivery nor the daily reconcile tried again. Now the owner lookup runs before the row is written, and its error is not caught. It reaches the webhook or reconcile boundary like any other unexpected failure. The row stays open, so the next delivery or reconcile applies the whole outcome once: the row, the code index, the opener's chip with its asks, and the other chips. Nothing was written before the failure, so the retry does not apply anything twice. A failed chip or Inbox item write is still logged and does not stop the work after it, as before. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A2186cef324c460e37246608055bd8216 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A2186cef324c460e37246608055bd8216) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A2186cef324c460e37246608055bd8216/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
22 tasks done
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.

Closes #3782.
A plugin could not change Conversation annotations and Inbox items in one transaction. When a pull request merged, the GitHub plugin closed its asks and marked its chips in separate writes, so a failed write left the chip and the ask out of step, and the
conversationandinboxItemsversion tokens moved at different times.Heartbeat and route contexts now have
ctx.conversationChanges.apply(batch). The batch is data:Core saves the batch in one transaction. Each entry uses the same write as its
forConversationcall (upsertPluginAnnotationandclosePluginInboxItemare now shared by both paths), so it has the same checks. When one entry fails, no entry is saved and the call throws. After the commit, core shows each closed item throughShowInboxItem(Slack cards and push).The GitHub plugin's ended pull request path (webhook and daily reconcile) now marks the chip of the Conversation that asked for the pull request and closes its next-action item and merge conflict notice in one batch. A failed batch is logged, as the separate writes were before.
Scope
codeChanges.record), annotation removes, and Inbox item upserts are not in the batch. No current user needs them.MAX_CONVERSATION_CHANGES). Core rejects a larger batch with an error. The GitHub batch has at most 3 entries.via @BYK.
--
View Session [Sentry]