Repository navigation
Description
Problem
After an interrupted turn (app restart, provider timeout, or a manual Stop), the only way to resume is the banner button on the interrupted turn itself ("Continue this turn", safeResumeAction in chat-turn.tsx). The composer send button always starts a new turn — there is no way to continue the interrupted run from the composer, which is where the user's attention is when they come back to type.
The renderer also cannot show resume availability proactively: interrupted-resume.ts (latestInterruptedResumeTurnId) decides eligibility with a local heuristic over the last turn's surface state (errorClass === 'app_restarted', timeout with all tools completed, renderer-stop abort). The authoritative decision only happens after the user clicks, so the UI cannot offer resume anywhere else without risking a wrong affordance.
Desired outcome
When the latest interrupted turn of the active session is authoritatively resumable and the composer input is empty, the composer send button is replaced by a Resume affordance that continues the interrupted run. Typing anything switches the button back to the normal "send new message" behavior.
The availability signal comes from the authoritative planner, not the renderer heuristic:
- Runtime Host already exposes the read-only
turn.resume.queryoperation (queryTurnResume→planTurnResumeinroot-turn-coordinator.ts), returning aTurnResumePlan—disposition: 'ready'(withsourceRunId/sourceTurnId/ high-water) or'parked'with a closed set of reasons (session_busy,safety_check_failed,resume_feature_disabled, workspace mismatch, …). It runs throughpreviewCapabilityBinding, so it previews without committing and has no side effects. - Desktop main already has
queryTurnResumeonruntime-host-client.ts, but it is only called insidesessions:resumeLatest(query → start in one shot); the query is not exposed to the renderer on its own.
This stays fail-closed: the query only produces a plan, and startTurnResume re-validates every boundary (workspace identity, high-water, tool catalog) before running — so if state changes between the button rendering and the click, the click either resumes correctly or returns the park reason. It never resumes the wrong thing.
Alternatives or workarounds
- Keep the status quo: resume only from the interrupted turn's banner. Works, but the user has to find the banner in the transcript instead of acting from the composer.
- Gate a composer Resume button on the existing renderer heuristic (
latestInterruptedResumeTurnId). Cheaper (no IPC), but it would surface Resume for turns the authoritative planner would park — a misleading affordance for exactly the cases the safe boundary exists to catch. - Add a separate Resume button next to Send instead of replacing Send. Rejected: two primary actions in one slot invites misclicks; swapping only while the input is empty keeps one unambiguous action per state.
Proposed implementation (small, follows existing seams)
- Main IPC: new read-only handler
sessions:queryResumeLatestthat callsclient.queryTurnResume({ sessionId })and passes the plan through to the renderer (preload +bridge-contract.d.tsgain the matching method). - Renderer: on
sessions:changedstatus-change / session switch, query once for the active session whose latest turn is an interruption candidate;disposition === 'ready'sets a per-sessionresumeAvailableflag. - UI: when
resumeAvailableand the composer input is empty, the send button slot renders Resume instead; the click reuses the existinguseShellResume.resumeInterruptedSession(already handles pending re-entrancy, park toast, failure toast). The turn banner button stays as is.
Activity
me2seeks commentedon Oct 1, 2026
take
fix(desktop): offer composer Resume after a manual Stop, drop the tur…