Skip to content

feat(followup): run a one-click follow-up start in the background - #34519

Merged
bolichen97 merged 1 commit into
mainfrom
pearcekieser/feat-followup-start-background
Nov 10, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
pearcekieser/feat-followup-start-background

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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

  • The default Start, which pre-fills the new session's composer. That flow still switches to the new session, because the person must press send there.
  • Add to this session and Skip.
  • What is sent and how: the prompt, the send path and the consent rules from feat(followup): opt-in one-click send for follow-up Start, with a prompt preview #25926 stay as they are.
  • A new notification or toast system. The result uses the existing shell notice.

What changed (motivation → approach → change)

In one-click mode, openFollowupSession now stops after the send. It does not call switchSlot. The new session is created with createSlot({ activate: false }) as before, so it is listed in the sidebar, and the turn runs there while the person stays put.

Outcome of a Run Before After
Send accepted The chat switched to the new session The person stays. The shell notice says where the follow-up runs and has an Open session button
Answer lost (transport error or late reply) Switch, then a notice in the new session The person stays. The same notice, as an error, says to open that session and check it, with Open session
Send refused Error on the card item Unchanged

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.ts gets an optional openSlot field. components/AgentSwitchNoticeBanner.tsx renders it as an Open session button that calls switchSlot with announceOnMissing and gesture, the same call a notification's Go to chat makes. It navigates to /chat only 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, SwitchSlotArg in chat/slotSwitch.ts takes an optional leaveSplit, which bumps a leaveSplitSeq counter in the chat state, and chat/page/activeSlotState.ts leaves Split View when that counter changes. The reopen-closed-session shortcut already leaves Split View by the same rule, through resumeFromHistory. 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. In shortcuts/shellKeyboard.ts, a notice with openSlot outside 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.json and 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". The suggest_followup tool description in control_parts/schemas.py, the comment on components/FollowUpCard.tsx, docs/followup-suggestions.md, the owning spec paragraph in docs/system-specs/modules/learn-cron-dashboard.md and 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 the unconfirmedHere and startOrigin fields of the openFollowupSession target. git grep on origin/main finds 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 passes started instead, covered by ChatPage.followUpStart.test.tsx
Reader: website/src/pages/useChatPageSlotSwitches.ts:useOpenFollowupSession -- chat -- read startOrigin only for the switch it no longer makes; runFollowupStart still 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 leaves activeSlot on the origin, makes no history read for the new slot, lists it in dashboard.slots, sends exactly one turn to it, and posts the notice with openSlot. A lost or late answer posts the error notice with openSlot and 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 with openSlot survives the 6 second expiry in the dashboard window and expires in a popout.
  • chatSlice.test.ts and ChatPage.reopenLeavesSplit.test.tsx: only a switch with leaveSplit bumps leaveSplitSeq, 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 new switchSlot site 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 /api call 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.

before: after Run the chat shows the new session

After: the origin session stays on screen, the other suggestion stays on the card, and the notice offers Open session.

after: the origin stays, 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.

after Open session: the new session with its running turn

The one-click footer says the person stays where they are.

the one-click card footer

A lost answer shows the error notice with Open session.

a lost answer: error notice with Open session

Related Issues

Builds on #25926.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Fixes #34518

@Pearcekieser
Pearcekieser requested review from a team and KiroCrewCaptain as code owners November 10, 2026 11:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 10, 2026
@Pearcekieser
Pearcekieser force-pushed the pearcekieser/feat-followup-start-background branch from f4b5f76 to 02ad78e Compare November 10, 2026 12:47
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 5d8b4c74e9278ecdf6eb551fbe2328aee10924f4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • leaveSplitSeq is a second, counter-based way to leave Split View, alongside lastResumeActivation.leaveSplit. If a third caller needs it, move both onto the counter instead of adding another signal.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 5d8b4c74e9278ecdf6eb551fbe2328aee10924f4 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • Item 3 — oversized: on base, the RFC's Accepted row says only "A page notice names the new session in the sidebar". The Open session button, and everything it needs (Split View exit, offline disable, frame suppression, the self-dismiss rule), goes beyond "stays on the session they are in", and the sidebar entry the item itself relies on already lets the person reach the session. Subtraction: drop openSlot from AgentSwitchNotice and the button in AgentSwitchNoticeBanner.tsx, and keep a plain notice. Clears when: the mechanism is removed, or a human amends the Goal.
  • Item 4 — second spelling: "leave Split View on this open" already has a channel, lastResumeActivation.leaveSplit (store/chat/lifecycle.ts:732, read at activeSlotState.ts:203). The new leaveSplitSeq counter is a second one, and its only consumer is the banner (grep leaveSplit: 1 non-test switchSlot caller). Subtraction: delete leaveSplitSeq together with item 3, or use the existing activation record instead.

What this change ships

Inventory (8 items) — 5 justified

Intent: let a person start one-click follow-ups without leaving the session they are reading. This is an ADDITION.

  1. One-click Run no longer switches to the new session — justified
  2. Success and lost-answer results now show in the shell notice instead of in the new session — justified
  3. The notice has an Open session button — oversized
  4. Opening a session from that button leaves Split View — one consumer, generalized
  5. A notice with Open session no longer expires after 6 seconds — undeclared rider of item 3
  6. Messages about the switch are removed from 13 locale catalogs — justified
  7. One-click card footers say "You stay where you are…" — justified
  8. The tool description, user doc, spec and RFC text describe the background run — justified

[FIRST-PRINCIPLES-REVIEWED] 5d8b4c7

Description read

[DESCRIPTION-READ] 27c59118324109c24afa89566ade4d7dec60b46d5fc8b7b9202c344ced4354fb

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 5d8b4c74e9278ecdf6eb551fbe2328aee10924f4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The project-directory footer now says "Run in new chat sends… a new chat… the new session shows in the sidebar", and the no-copy notice followup_started_in_chat says "new chat". Use one word, matching what the sidebar header calls these items ("Sessions").
  • No screenshot shows the no-copy notice "The follow-up is running in a new chat." or the offline state where Open session is disabled. Attach a still of each so both can be reviewed.
  • The footer footer_worktree_start_sends now runs to six sentences of muted prose, and the blind reader said they'd "likely not read it all". Cut "Your current files and this session stay as they are." because the new "You stay where you are…" sentence already covers it.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 5d8b4c74e9278ecdf6eb551fbe2328aee10924f4 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 5d8b4c7

Verdict parsed from the review's SHA-scoped output markers for commit 5d8b4c74e9278ecdf6eb551fbe2328aee10924f4.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 5d8b4c74e9278ecdf6eb551fbe2328aee10924f4 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 5d8b4c74e9278ecdf6eb551fbe2328aee10924f4 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 5d8b4c7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 5d8b4c74e9278ecdf6eb551fbe2328aee10924f4 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 10, 2026
@Pearcekieser
Pearcekieser force-pushed the pearcekieser/feat-followup-start-background branch from 02ad78e to 5d8b4c7 Compare November 10, 2026 13:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 10, 2026
@Pearcekieser

Pearcekieser commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=1a5240ee0e2e Open session leaves the follow-up hidden behind Split View

fixed in 5d8b4c7: Open session now calls switchSlot with leaveSplit. That bumps chat.leaveSplitSeq in switchSlot.pending, and activeSlotState leaves Split View when the counter changes, the same rule the reopen shortcut follows through resumeFromHistory.
Tests: "a slot switch that asks to leave Split View shows the opened chat" in ChatPage.reopenLeavesSplit.test.tsx, and "records only switches that ask to leave Split View" in chatSlice.test.ts.

@Pearcekieser

Pearcekieser commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=1a5240ee0e2e An already-selected session silently loses its delivery error

fixed in 5d8b4c7: once the notice names the active session, the banner clears it only when it is plain status. An unconfirmed-delivery error stays, and only its Open session button is hidden.
Test: "keeps an unconfirmed-delivery error once that session is on screen, without the button" in AgentSwitchNoticeBanner.test.tsx.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 10, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, openFollowupSession stops after the send. The forkMayOpen / switchSlot block is gone, and a shell notice names the session with openSlot. An unconfirmed delivery shows the same notice as an error.
  • The Open session button switches with announceOnMissing, gesture and leaveSplit. It goes through guardedLeave, 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.
  • leaveSplitSeq only 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.

@bolichen97
bolichen97 merged commit 0f3f328 into main Nov 10, 2026
97 of 98 checks passed
@bolichen97
bolichen97 deleted the pearcekieser/feat-followup-start-background branch November 10, 2026 15:03
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow-up card: one-click Run starts in the background and keeps the user on their session

2 participants