Repository navigation
fix(dashboard): Show inbox messages near the ask - #2622
Merged
Merged
Conversation
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 |
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 6e8734b. Configure here.
dcramer
approved these changes
Nov 3, 2026
dcramer
pushed a commit
that referenced
this pull request
Nov 4, 2026
) Stacked on #2622. A person change to a Review item (take, answer, dismiss) reaches each linked Conversation as a message. Before, the dashboard could not tell those messages apart from typed text: they filled the inbox excerpt and showed as long relay text. The first marker here (a bare `reviewItemId`, rendered from the item's live state) made a take or dismiss message show a later answer and a Done chip. A message is a historical record, so it must show what it did, not what the item looks like now. ## Design **One record per change, on the message that records it.** `reviewItemChange: { kind: "submitted" | "dismissed" | "taken", reviewItemId }` (`review-items/change-record.ts`). It is named after `ReviewItemChange`, the change type that `sendReviewItemMessages` already sends. `ReviewItemAction` is the take/submit/dismiss verb, so "action" would collide. Only person changes have a record. `replied` and agent `closed` stay as they are. **Provider-neutral on the inbound input.** The record is an optional field on the mailbox `AgentInput`, not on any source's metadata. All three paths set it: - Web: `sendOne` → `appendAndEnqueueWebMessage` → `buildWebInboundMessage`. `reviewItemId` is gone from the legacy web metadata. - Slack card in its own thread: `slack-review-item.ts` `act` passes `{ reviewItemChange }` to `persistMessage`, through slack-interactive/slack-form/slack-webhook, to `buildSlackInboundMessage`. A Slack Turn passes Chat SDK messages, not mailbox input, so `restoreMessage` binds the record to the message (same pattern as `bindMessageAuthorIdentityId`) and `toConversationMessage` writes it to `meta.reviewItemChanges`. - Event relay to Conversations that do not take web messages: `sendOne` sets it on the event input. A relay is not one of the saved Message's own Events: `eventBatchMessageMeta` puts its record in `meta.reviewItemChanges`, never in `events`. In every event batch, the Message's own Event is the first Watch Event, or the first other input when there is no Watch Event. `events` lists Watch Events only, so the heading count and the shared label match the Watch task message. A unit test covers the order. **One list on the saved Message.** Every saved Message stores its records as `meta.reviewItemChanges` (a person Message has one, a batched event Message can have several). The inbound input keeps a single `reviewItemChange`. **One saved user Message per inbound web message.** A web Turn that takes several queued messages saves each one in order, each with its own record. A resumed Turn rebuilds its prompt from every input message on its `turn_started` event. `excludeMessageIds` keeps all of them out of the context block. **Dashboard renders from the record, not live state.** `ReviewItemChangeRow`: "Answered / Took / Dismissed <title>", linking to the item. Only an answer shows the submitted fields. An answer is final, so reading it from the item is safe. No status chip. Falls back to the text when the viewer cannot read the item. Event messages render each relay as its change row instead of an event line, so a relay shows once. A Message that only records changes shows rows only. Pending (queued) messages show the same verb and title on their one line. The inbox excerpt drops change rows from any message and skips the message only when nothing else remains (`excerptMessage`), so a mixed batch shows its Watch events but no change rows. Report message events expose `reviewItemChanges`, and pending messages expose `reviewItemChange`, only when the payload is visible (redacted refines updated). ## Deferred - **One model message per inbound message.** The model still gets one joined prompt. The relay text stays the model-facing text. Splitting it changes the Pi prompt checkpoint and replay contract (`planPromptReplay`/`checkpointedPrompt`) for every Turn kind, which is out of scope for a dashboard record. ## Rollout `agentInputSchema` is strict. During a rolling deploy, an old worker drops a mailbox entry that has `input.reviewItemChange`: only Review item change messages queued in that window. If that is not OK, land the schema field first in its own deploy (same split as #2473/#2482). ## Tests - Integration: `actions.test.ts` (submit records on every linked Conversation; take on web, take via event relay, dismiss), `review-item-card-webhook.test.ts` (Slack card submit on both threads, dismiss). - Unit: `eventBatchMessageMeta` (heading count, shared label, relay records, own Event order), Slack Message binding, per-message web save, report projection. - e2e `review-desk.spec.ts`: take + answer show as rows and stay out of another item's excerpt; a mixed event batch keeps its Watch events in the excerpt without change rows. - Integration eval in `steering.eval.ts` for a batched dashboard Turn. ## Visual QA (mock data) | | Before (#2622) | After | |---|---|---| | Take then submit, transcript |  |  | | Slack card + event relay, transcript |  |  | | Mixed batch, inbox excerpt |  |  | | One answer, pending |  |  | Relays kept out of a Message's own Events (before: 46bc8cd, relays in `events`, so each showed twice and the heading lost its count and label): | | Before (46bc8cd) | After | |---|---|---| | Slack card + event relay, transcript |  |  | | Slack card + event relay, inbox excerpt (unchanged) |  |  | | Watch events + relay, transcript |  |  | | Watch events + relay, inbox excerpt |  |  | <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Abbf2198a76713185f89423b04dbff7f0 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Abbf2198a76713185f89423b04dbff7f0) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Abbf2198a76713185f89423b04dbff7f0/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
thomasjiangcy
pushed a commit
that referenced
this pull request
Nov 4, 2026
Main CI on 38c8693 (#2625) fails `check / types`, `test / junior unit`, and `test / dashboard e2e`. **Types and unit.** #2625 added `web-batch-messages.test.ts` with `webActorFromEmail`. #2630 removed it. The test now uses `webActorFromUser(testViewer(...))`, the same fix as c1e36af in #2631. **Dashboard e2e.** `conversations-mobile.spec.ts` "keeps the message in view while earlier history and late content load" is flaky. It is not a regression from #2622 or #2625: - Main CI: failed on f23838b (#2622, which only changes `ReviewItemContext.tsx`) and 38c8693. Passed only on retry on 38597fb. Each of these failed at line 752, the last step (spacer above the reader). - #2634 added `scrollIntoViewIfNeeded()` right before that step. The scroll event fires on the next frame. When the test appends the spacer first, the transcript's scroll handler records the reader's place from the layout that already has the spacer. The resize correction then sees no shift. Local logs showed this order in every failure and the opposite order in every pass. - The test now waits one frame after each scroll so the scroll event runs first. Assertions are unchanged. Locally the last step went from 6 failures in 16 runs to 0 in 160. **Still open.** Under 4 parallel workers, 7 of the 160 local runs failed one step earlier (after the earlier page loads). I did not measure that step on main without this change. In the one failure I logged, the correction ran twice: `scrollTop` moved by exactly 2× the shift. That points to a product race in `transcriptBottomPinning.ts`, not a test race. This PR does not fix it. I have not seen it fail in CI. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A586024895340456299c9cfbe04e88e91 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A586024895340456299c9cfbe04e88e91) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A586024895340456299c9cfbe04e88e91/?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
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.

The inbox excerpt showed the 3 messages before an item and the newest 8 messages after it. In a Conversation with several decisions, each answer posts a message, so the "after" part filled up with answers to other items and moved away from the context of the ask.
Now the excerpt shows the 3 messages before the ask and the first 3 after it. For a closed item, it stops at the close, so the item's own answer (already in the card) and later activity do not show.
One gap remains: an open item can still show an answer to another item if that answer is one of the first messages after its ask. Answers sent from the web are plain person messages, so the dashboard cannot tell them apart without a marker from the API. I left that out of this PR.
via @dcramer.
--
View Session [Sentry]