Repository navigation
fix(e2e): member-memory legacy V1 spec -- stale page idles the slot under a deep-link send - #19263
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Check that the member-memory E2E spec passes on its first try. That is the only thing showing the composer keeps its "Message …" placeholder after a send from a chat opened by link. [UX-REVIEWED] 235b02a Description read[DESCRIPTION-READ] a2473bd9c4de025687cfd5d3cb5df3bb0b10459d6291993291acda4f6f7ed4a7 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that What this change shipsInventory (3 items) — 3 justifiedIntent: after opening a chat by link and sending right away, the chat stays busy until the reply arrives, instead of briefly offering Resume. This is a FIX (closes #19260; three of the added tests fail on base).
[FIRST-PRINCIPLES-REVIEWED] 235b02a Description read[DESCRIPTION-READ] 6d966ce349361c80f98816a962cd2fd37c3a5c4b88f6310274932b1e65b4b774 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check one race: an idle page that misses the send, landing after the turn's own done frame, must leave the slot idle, not keep it running. [DESIGN-REVIEWED] 235b02a Description read[DESCRIPTION-READ] 5780a360d9f10a69942f8f271005f32e77b93ed418a2260050bf79648bf7ea8b That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
cf5d9f3 to
63acb42
Compare
|
Main is red on this head's base (8f6baa0) in two jobs this PR does not touch, same jobs fail on main run 38207918790: |
63acb42 to
235b02a
Compare
iamwhatever
left a comment
There was a problem hiding this comment.
This PR fixes the composer switching to the "Last turn was interrupted" placeholder right after a deep-link send. The cause was switchSlot.fulfilled copying running: false from a page that was read before the send. Now an idle page that does not carry a live send (liveSends) leaves slotState, slotRunning, slotStopping, pendingTurnSlot and the chunk floor as the send, a live slots frame or a chunk set them. I read the reducer around the change. The slotState assignment moved below the message merge, with no early return in between, so every path still sets it, and a fetch with no live send writes exactly the old state. I tried to make it revive or stick a turn. A send whose POST was refused stays idle, because endLocalTurn already set that. A page that caught the send, or reports running, lands as before. A chunk floor raised during the fetch survives. Each of these is a test, and the first three cannot pass on the parent tree. The other refresh reducer (slotRefresh.ts) is left alone and tracked in #19267, which is the right scope. Checks are green and all three lanes PASS. — crew-pr-reviewer (deep re-check)
…state refreshSlot.fulfilled rebuilt the transcript from a count-matched page and kept only the head above the page's first row (olderHeadAbovePage), then copied the page's run verdict. A send made while the fetch was in flight (the refresh fires on socket reconnect and on chat_done) is newer than the page, so the rebuild dropped the user's row, and the page -- read before the send -- idled the slot (slotRunning, pendingTurnSlot) under the turn the send opened, offering Resume on a running turn. The liveFrameSeq guard protected only slotState. Give refreshSlot a dispatch-time baseline (liveFromAtDispatch), keep the user rows past it with a sendId the page does not carry (tailNotInPage), and skip the page's idle run verdict when such rows exist -- the pagePredatesLiveSend guard switchSlot.fulfilled already uses (kirodotdev#18658 / kirodotdev#19263). Fixes kirodotdev#19267
…state refreshSlot.fulfilled rebuilt the transcript from a count-matched page and kept only the head above the page's first row (olderHeadAbovePage), then copied the page's run verdict. A send made while the fetch was in flight (the refresh fires on socket reconnect and on chat_done) is newer than the page, so the rebuild dropped the user's row, and the page -- read before the send -- idled the slot (slotRunning, pendingTurnSlot) under the turn the send opened, offering Resume on a running turn. The liveFrameSeq guard protected only slotState. Give refreshSlot a dispatch-time baseline (liveFromAtDispatch), keep the user rows past it with a sendId the page does not carry (tailNotInPage), and skip the page's idle run verdict when such rows exist -- the pagePredatesLiveSend guard switchSlot.fulfilled already uses (#18658 / #19263). Fixes #19267
…state refreshSlot.fulfilled rebuilt the transcript from a count-matched page and kept only the head above the page's first row (olderHeadAbovePage), then copied the page's run verdict. A send made while the fetch was in flight (the refresh fires on socket reconnect and on chat_done) is newer than the page, so the rebuild dropped the user's row, and the page -- read before the send -- idled the slot (slotRunning, pendingTurnSlot) under the turn the send opened, offering Resume on a running turn. The liveFrameSeq guard protected only slotState. Give refreshSlot a dispatch-time baseline (liveFromAtDispatch), keep the user rows past it with a sendId the page does not carry (tailNotInPage), and skip the page's idle run verdict when such rows exist -- the pagePredatesLiveSend guard switchSlot.fulfilled already uses (#18658 / #19263). Fixes #19267
Problem / Motivation
Goal: A message sent right after opening a chat by link keeps the chat busy until the reply comes.
Open a session by link (
/chat?sid=…) and send at once. For a few seconds the composer stops sayingMessage …and saysLast turn was interrupted — press Resume, or just typeinstead, while the reply is on its way. The E2E specmember-memory.spec.ts:396 › a legacy configured default member keeps V1 …does exactly this and fails at line 440:getByPlaceholder(/message/i)finds no element for 5 s, then the spec passes on a retry, which the zero-flaky ceiling turns into a red job. Seen on two unrelated heads that both already carry #18658: run 38128323368 (head dbc9c3e) and head 09c21fe (fix/8683-stdin-redirect-scan).Why it matters
A composer that says the turn was interrupted, right after you sent, tells you your message failed. People press Resume or send again and the agent does the work twice. The E2E gate has a zero-flaky ceiling, so this one spec also reddens any PR it lands on.
Not a goal
What changed (motivation → approach → change)
Opening a slot runs
switchSlot.pendingmakes the composer live and sends the page fetch. A send made in that window opens a turn:startLocalTurnmarks the slot running and pending. The page was read before the send, so it saysrunning: false. #18658 madefulfilledkeep the sent row; it still copied the page's run verdict, soslotRunningwent false andpendingTurnSlotwas cleared under a turn the server was already running. "User row last, slot idle" is the shapeselectContinuableoffers Resume on, soChatInputswapped its placeholder. Nothing re-asserted the run until the reply's first chunk; aslotsframe saying running that landed before the page was overwritten with it.switchSlot.fulfilled(website/src/store/chat/slotSwitch.ts) now treats an idle page that does not carry a live send (liveSends, the rows #18658 keeps) as read before that send. For such a page it leaves the run state alone:slotState,slotRunning,slotStopping,pendingTurnSlotand the chunk floor stay what the send, a liveslotsframe or a chunk set. A page that reports running, or one that already carries the send, lands exactly as before. Kept, not forced: a send whose POST was refused (endLocalTurn) stays idle.The other reducer that replaces the view from a page, the reconnect / end-of-turn refresh in
slotRefresh.ts, is left as is: it has no live-send baseline at all (it drops the row too), so its fix is the whole pair and is tracked in #19267.Backwards compatibility
Compatible: one condition in one reducer branch; every
switchSlot.fulfilledwith no send during the fetch (liveSendsempty) writes the same state as before.Removes nothing: additive guard only.
Tests
website/src/test/chatSlice.switchSlotLiveSend.test.ts: an idle page that predates the send leaves the slot running and pending andselectContinuablefalse; the same after a liveslotsframe confirmed the turn (pending mark already retired); a chunk floor raised during the fetch survives the page; a refused send is not revived; a page that caught the send takes its idle verdict; a running page lands as before. On the parent tree the first three cannot pass:fulfilledwritesslotRunning = falseandlastChunkSeq = undefinedthere.Manual verification
N/A — unit coverage sufficient: the symptom is a pure reducer outcome (
slotRunning/pendingTurnSlotafterswitchSlot.fulfilled), and the placeholder is derived from it by existing selectors with their own tests. The E2E spec on CI is the integration check.Screenshots / video
Why no screenshot: no layout, copy or style changes; the composer keeps the placeholder it already showed, where before it swapped to the interrupted-turn one for a few seconds.
Related Issues
Closes #19260
Pattern harvest
Rule candidate: review-prompt
Pattern: a reducer that replaces a view with a fetched snapshot must carry forward every local state the user established after the fetch was issued — rows AND run state — not one of them.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)