Repository navigation
feat(followup): run a one-click follow-up start in the background - #34519
Conversation
f4b5f76 to
02ad78e
Compare
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The change follows the accepted RFC's card-3 step, nothing outside the patch still reads the removed keys or fields, and the PR includes screenshots of this revision. Notes
[DESIGN-REVIEWED] 5d8b4c7 Description read[DESCRIPTION-READ] 61f727394b583996013a9089d0887f4285d255fe8c52cca12529a10efe8d8de5 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The accepted base RFC lists card-3 ("start without switching") as its third rollout step, so the background run has a recorded decision. Two notes follow on how wide the change is. Notes
What this change shipsInventory (8 items) — 5 justifiedIntent: let a person start one-click follow-ups without leaving the session they are reading. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 5d8b4c7 Description read[DESCRIPTION-READ] 27c59118324109c24afa89566ade4d7dec60b46d5fc8b7b9202c344ced4354fb That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read "Open session" correctly in both the success and error notices, was sure of it, and said they would click it. The new footer sentence is visible in shot-02. Notes
[UX-REVIEWED] 5d8b4c7 Description read[DESCRIPTION-READ] 967174e4d7dea78335aadc69512b1c8ac68e5852f192b52f1b62ab6acdfda6b2 That sha256 names everything this verdict read: the PR description, plus the 8 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 |
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: |
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: |
02ad78e to
5d8b4c7
Compare
|
|
bolichen97
left a comment
There was a problem hiding this comment.
Approve on 5d8b4c7. I read the whole diff (1744 lines), tests included. This fixes #34518 and is card-3 of the accepted rfc-followup-start-sends.md.
- It stays opt-in. Only
mode === 'send'(the "Send follow-ups with one click" setting from #25926) changes. The default Start still pre-fills and switches to the new session. The setting, its default and the consent rules are untouched. - In send mode,
openFollowupSessionstops after the send. TheforkMayOpen/switchSlotblock is gone, and a shell notice names the session withopenSlot. An unconfirmed delivery shows the same notice as an error. - The Open session button switches with
announceOnMissing,gestureandleaveSplit. It goes throughguardedLeave, is disabled offline, and is hidden in popout and embed frames. The plain notice drops once that session is on screen, and an error keeps its text. leaveSplitSeqonly acts on a change after mount. The callsite classification test is updated (page −1 plain, banner +1 gesture/announced).- The removed focus strings are gone from every catalog. The tests cover staying on the origin, the offline and draft cases, the drop-on-target case, leaving Split View, and the timer rules. There is no regex.
- All 97 checks are green, and nobody else has an open change request.
Problem / Motivation
Goal: With "Send follow-ups with one click" on, Run starts the follow-up in a new session in the background and keeps the user on the session they are in.
Today Run creates the new session, sends it the prompt, and then switches the chat to it. The person loses their place in the session they were reading, and has to go back to it to use the other suggestions on the card. The follow-up RFC (
docs/request-for-change/rfc-followup-start-sends.md, on main as accepted) lists this as card-3, the step after #25926.Why it matters
A follow-up card often has more than one suggestion. When each Run moves the person away, they cannot start two follow-ups in a row, and every Run interrupts what they were doing in the origin session.
Not a goal
What changed (motivation → approach → change)
In one-click mode,
openFollowupSessionnow stops after the send. It does not callswitchSlot. The new session is created withcreateSlot({ activate: false })as before, so it is listed in the sidebar, and the turn runs there while the person stays put.The result goes in the existing shell notice, because the item leaves the card when its send is accepted and the card itself is gone when that was its last item. The notice type in
utils/agentSwitchFeedback.tsgets an optionalopenSlotfield.components/AgentSwitchNoticeBanner.tsxrenders it as an Open session button that callsswitchSlotwithannounceOnMissingandgesture, the same call a notification's Go to chat makes. It navigates to/chatonly from a non-chat page, and asks the page's leave guard first. The switch also leaves Split View, because the grid would otherwise keep its own panes and not show the opened session. For that,SwitchSlotArginchat/slotSwitch.tstakes an optionalleaveSplit, which bumps aleaveSplitSeqcounter in the chat state, andchat/page/activeSlotState.tsleaves Split View when that counter changes. The reopen-closed-session shortcut already leaves Split View by the same rule, throughresumeFromHistory. The button is disabled while the gateway is offline, because a switch then activates the session before its history read fails. A popout or embed frame keeps its own session model, so the notice there has no button. Inshortcuts/shellKeyboard.ts, a notice withopenSlotoutside a frame does not expire on the 6 second timer. Once that session is the active one, the banner drops a plain notice, and an unconfirmed-delivery error keeps its text without the button.The focus messages that only a switch could produce after a send are gone from
locales/en.manual.jsonand the 12 other catalogs: two worktree strings and the "this session" variant of the unconfirmed notice. The pre-fill path keeps its own not-opened and not-focused messages. The one-click card footers add one sentence: "You stay where you are, and the new session shows in the sidebar." The unconfirmed notice now says the session "was created" instead of "opened". Thesuggest_followuptool description incontrol_parts/schemas.py, the comment oncomponents/FollowUpCard.tsx,docs/followup-suggestions.md, the owning spec paragraph indocs/system-specs/modules/learn-cron-dashboard.mdand the RFC's Decision 1 and failure table describe the background run.Backwards compatibility
Compatible: with one-click send off nothing changes, and with it on the same prompt is sent to the same session through the same path. Only the switch afterwards is removed.
The diff removes three i18n keys (
followup_worktree_sent_session_not_opened,followup_worktree_sent_session_not_focused,followup_prompt_unconfirmed_here) and theunconfirmedHereandstartOriginfields of theopenFollowupSessiontarget.git greponorigin/mainfinds one reader of each:Reader: website/src/pages/chat/page/followupCardActions.ts:useFollowupStarts -- chat -- the only caller of the three keys and of
openFollowupSession; it now passesstartedinstead, covered byChatPage.followUpStart.test.tsxReader: website/src/pages/useChatPageSlotSwitches.ts:useOpenFollowupSession -- chat -- read
startOriginonly for the switch it no longer makes;runFollowupStartstill reads it for error routing, covered by "shows a refused send on the page after the user switches sessions"Tests
ChatPage.followUpStart.test.tsx: a one-click Run on both routes leavesactiveSloton the origin, makes no history read for the new slot, lists it indashboard.slots, sends exactly one turn to it, and posts the notice withopenSlot. A lost or late answer posts the error notice withopenSlotand keeps the person in place. A refused send still shows on the card item. The tests that asserted a switch after a send, or its focus messages, are removed.ChatPageFollowup.test.tsx: the page-level Run, double click and non-git Run stay on the origin with one send.AgentSwitchNoticeBanner.test.tsx: Open session switches and navigates from another page, switches without asking on/chat, opens nothing when the page keeps its draft or the gateway is offline, shows no button in a popout or embed frame, the offer is dropped once that session is active, and an unconfirmed-delivery error stays there without the button.createdChatView.test.tsx: a notice withopenSlotsurvives the 6 second expiry in the dashboard window and expires in a popout.chatSlice.test.tsandChatPage.reopenLeavesSplit.test.tsx: only a switch withleaveSplitbumpsleaveSplitSeq, and such a switch replaces the Split View grid with the opened chat.FollowUpCard.test.tsx: the one-click footers carry the new sentence.switchSlotCallsiteClassification.test.ts: the banner's newswitchSlotsite is classified as announced and gesture, and the hook loses one plain site.Proof: not provable -- frontend test (prove.py runs Python only)
Determinism: the six changed vitest files pass 5 runs in a row and one run with
--sequence.shuffle.Manual verification
Built the SPA from this branch and drove it with Playwright against a loopback static server, with every
/apicall and the websocket answered from dummy fixtures. One-click Run on a two-item card kept the origin session on screen, removed the started item, added the new session to the sidebar and showed the notice. Open session switched to the new session, which showed the sent prompt and a running turn. With the send POST reset, the error notice offered Open session.Screenshots / video
Before, on main: Run moves the chat to the new session.
After: the origin session stays on screen, the other suggestion stays on the card, and the notice offers Open session.
Open session, the card footer, and a lost answer
Open session switches to the new session, where the turn runs.
The one-click footer says the person stays where they are.
A lost answer shows the error notice with Open session.
Related Issues
Builds on #25926.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Fixes #34518