Skip to content

feat(desktop): offer authoritative turn resume from the composer send slot #5903

Closed

Description

@me2seeks

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.query operation (queryTurnResume → planTurnResume in root-turn-coordinator.ts), returning a TurnResumePlan — disposition: 'ready' (with sourceRunId / sourceTurnId / high-water) or 'parked' with a closed set of reasons (session_busy, safety_check_failed, resume_feature_disabled, workspace mismatch, …). It runs through previewCapabilityBinding, so it previews without committing and has no side effects.
  • Desktop main already has queryTurnResume on runtime-host-client.ts, but it is only called inside sessions: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)

  1. Main IPC: new read-only handler sessions:queryResumeLatest that calls client.queryTurnResume({ sessionId }) and passes the plan through to the renderer (preload + bridge-contract.d.ts gain the matching method).
  2. Renderer: on sessions:changed status-change / session switch, query once for the active session whose latest turn is an interruption candidate; disposition === 'ready' sets a per-session resumeAvailable flag.
  3. UI: when resumeAvailable and the composer input is empty, the send button slot renders Resume instead; the click reuses the existing useShellResume.resumeInterruptedSession (already handles pending re-entrancy, park toast, failure toast). The turn banner button stays as is.

Activity

  1. added
    enhancement
    on Oct 1, 2026
  2. me2seeks commented on Oct 1, 2026

    @me2seeks
    ContributorAuthor

    take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions