Skip to content

ref(review-desk): Deliver every Review item change through one path - #2481

Merged
dcramer merged 2 commits into
mainfrom
feat/review-item-change-delivery
Nov 1, 2026
Merged

dcramer merged 2 commits into
mainfrom
feat/review-item-change-delivery

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Before this change, each Review item change path did its own "save, then sync Slack cards, then send messages" sequence: agent add, agent update, agent close, take, person close, the Slack card fallback, and the reply in the thread from #2491/#2494. Review item code also called Slack code directly. That included SlackAdapter and syncReviewItemSlackCards in actions.ts, getProductionSlackAdapter in the review desk API, and a separate Slack Identity query in assignees.ts.

One path after a change. review-items/changes.ts adds deliverReviewItemChange. It shows the new state on every surface, then sends a person action, a reply, or an agent close to the other linked Conversations. Every change uses it:

  • the agent tools (addReviewItem, updateReviewItem);
  • the person actions in actOnReviewItem (review desk API and Slack card clicks);
  • the reply in the thread (closeReviewItemsAnsweredByReply, from Slack ingress and the dashboard message API);
  • the Slack ingress fallback when a card click cannot be saved to its thread.

sendReviewItemMessages now has one caller: deliverReviewItemChange. An agent content change sends no messages, the same as before.

Slack stays in Slack-owned code. App setup gives Review item code its Slack parts:

  • ShowReviewItem: createSlackReviewItemShow in chat/slack/review-item-card-sync.ts. api.ts, the dashboard message API, Slack ingress, and the tool setup wire it.
  • FindMentionedUserId: Slack mention lookup now lives in chat/slack/review-item-tools.ts. It goes through readActorIdentityFromSql(createSlackActor(...)) and replaces the separate query.

A new dependency-cruiser rule, no-review-items-to-slack, blocks imports from chat/review-items/ and chat/tools/review-items.ts into chat/slack/.

The app queue. The Review item tools sent their messages through the Vercel queue, also when the app has its own queue. In the behavioral evals of #2478, an agent close failed with an OIDC token error. The agent runner now gives tools the queue of the app (conversationWorkQueue in the agent environment), the same queue that spawnAgent and messageAgent use. Without one, the tools use the Vercel queue as before.

Telemetry. A new review_item.deliver span has app.review_item.* attributes. A new review_item.message.failed warning names each Conversation that missed a message, and the change call still fails as before. TELEMETRY.md has a new Review items section.

Not done here: queue delivery. Delivery stays inline:

  • A per-topic job, like Workspace snapshot jobs, needs a new topic, a callback route, a Nitro trigger, and worker wiring.
  • It would not remove the retry rules: a send to the queue after the save can still fail. Only an outbox table written in the same transaction would remove them, and that is a new mechanism.
  • The messages are already durable mailbox appends with idempotency keys.

So the retry rules (retriesClose, isSameClose, isOnlyAssignee, firstCloseOnly) all stay. The README section "After a change" explains this.

Behavior changes:

  • A retry of a reply, or a later reply from the same person, now also shows the cards of the items that the person closed by reply again. Before, it sent only the missing messages. This is the same as a retried person action, and it repairs a card whose earlier sync failed.
  • The agent-facing assignee text says "a mention such as <@U123>" instead of "a Slack mention". The Slack mention error text is the same.

via David Cramer.

--

View Session [Sentry]

@vercel

vercel Bot commented Oct 31, 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 Nov 1, 2026 8:06pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Oct 31, 2026
Base automatically changed from ref/review-item-access to main October 31, 2026 05:01
Add deliverReviewItemChange. The agent tools and the person actions call
it after they save a change. It shows the new state on every surface,
then sends the messages to the other linked Conversations.

App setup now gives Review item code its Slack parts: the card sync as
a show function and Slack mention lookup for the agent tools. Review item
code, the agent tools, and the review desk API no longer import Slack
code. A dependency-cruiser rule keeps it that way. Mention lookup uses
the Actor to Identity entry point.

Add the review_item.deliver span and the review_item.message.failed
event, and document the Review item telemetry.

Co-Authored-By: David Cramer <[email protected]>
The Review item tools sent their messages through the Vercel queue, also
when the app has its own queue, such as in evals. A close then failed
with an OIDC token error. The agent runner now gives tools the queue of
the app, the same queue that spawnAgent and messageAgent use.

Co-Authored-By: David Cramer <[email protected]>
@dcramer
dcramer merged commit 3789d60 into main Nov 1, 2026
45 checks passed
@dcramer
dcramer deleted the feat/review-item-change-delivery branch November 1, 2026 21:08

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 9f0ad9fb Deployed Nov 1, 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