Steer a run
An agent user wants to stop, cancel, resume or retry an agent's work when it waits for them or goes wrong.

As an agent user, I want to stop, cancel, resume or retry what my agent is doing, so that I stay in control of work done in my name.

Situation

I am in a conversation. The agent is working, is waiting for me, has paused, or its last reply failed. The controls are at the end of the conversation, reachable with the keyboard open.

What I do

    To halt a reply in progress, tap "Stop" on the status line at the end.

    To let a waiting run go on, tap "Answer" or "Resume" on its card.

    To end a run for good, tap the red "Cancel" on its card.

    To get a failed reply again, tap "Retry reply" under the error.

What I should see

    While the agent works, the last row of the Agent session is a status line ("Thinking…", "Running a tool…" or "Replying…") with "Stop".

    After "Stop" the status line goes away, the run's badge reads "Canceled" and I can write again.

    A run that needs me has the badge "Waiting", a note such as "Waiting for an answer." and a button "Answer".

    A run that stopped on its budget has the note "Paused on its budget. Resume to continue." and a button "Resume".

    After "Answer" or "Resume" the run continues and its badge ends at "Done".

    A run that waits on a timer or on sub-tasks says so and has no answer button.

    Every run still in progress has a red "Cancel" on its run card.

    A waiting run does not lock the message field. I can still send a message.

    When the agent's turn failed, the error is shown in red. "Retry reply" is under it only when it is the last thing in the conversation and nothing is being written.

    After "Retry reply" the agent answers again below the error. My own message is not repeated, and "Retry reply" is gone.

    A conversation driven by another one has no message field. The line "Driven by a parent conversation. Open it to intervene." opens the parent, where I can act.

When something goes wrong

    If a stop, cancel, answer or retry is refused or does not get through, a red line at the end of the conversation gives the reason with "Retry". "Retry" reloads the conversation. I then tap the control again.

Not included

    "Answer" is one tap that lets the run go on. I cannot type an answer on the card or choose between answers. To say something, I send a message.

    There is no confirmation before "Cancel" or "Stop", and neither can be undone.

    Cancelling a run from its card has no automated screen test yet.

Trace

Story US-AGENT-07, status Shipped. These links are kept in step with the traceability matrix and with the "User stories" section of every page listed here.

Design

Page

Part it plays

Agent session

Stop, Retry reply, Answer, Resume and Cancel, and the child session state

Session timeline

Turn error rows, pinned runs and the status line at the tail

AgentRunCard

Answer, Resume and Cancel on the card; waiting notes

AgentError

The failure line when a command is refused

Badge

Waiting, Canceled, Done and Failed badges

Buttons and actions

Destructive Cancel and plain action buttons

Confirmations and alerts

Where confirmations are and are not used

Badges, countdowns and connection status

Run badges and countdowns

States for every screen

Agent working, waiting on me and reply failed states

Honest state: loading, failure and empty

Controls stay in the transcript, reachable with the keyboard open

Platform colour roles in use

Red for destructive and failed

Implementation

Page

Part it plays

Agents: reads, commands and the clock

The stop, retry, cancel and signal commands

Agents: chat rows and run cards

runRow: waiting, signal, note and live; error rows

Agents: screens and components

Where the controls are drawn and when Retry reply is offered

Agents: WebSocket streams as resources

Status and run changes that follow a command

Agents: signed action envelope and endpoints

Signed StopSession, RetrySession, CancelRun and SignalRun

Agents server

The four actions and run wait reasons

Root declarations: Activity and Agents

agentsChanged, agentsError and the command actions

State, refresh and stale-reply patterns

Mutation refreshes agentsData and agentsRunData

Contract UI tests

The UI tests of answer, stop, retry and resume

Mock agents server

Scripted waiting, budget pause and failed turn sessions

Bun unit tests

Unit tests of waiting runs and command timestamps

Code

File

What

agents.contract L451-468

Run card note, Answer or Resume, Cancel

agents.contract L544-551

Status line with Stop

agents.contract L573-578

Turn error with Retry reply

agents.contract L597-599

Parent line in a child conversation

app.contract L183-187

agentsError and the agentsChanged mutation

app.contract L517-524

agentsStop, agentsRetryTurn, agentsCancel, agentsSignal

app.contract L525-540

agentsAfterChange

src/agents/sources.ts L486-492

stop, retry, cancel and signal commands

src/agents/model.ts L326-347

Wait note, waiting and signal in runRow

src/agents/model.ts L284-285

Turn error row

Tests

File

What it checks

agents.test.contract

a waiting run can be answered and a subsequent run can be stopped

agents.test.contract

RetrySession recovers the failed assistant reply without duplicating the user message

agents.test.contract

timer waits show a countdown and budget pauses resume through SignalRun

src/agents/__tests__/agents.test.ts

transcript and run presentation: settled plans freeze at the server stamp, while waiting runs remain pinned

src/agents/__tests__/review.test.ts

commands sign with the caller clock, never a server-reported time

Delivery

Delivered by #1470.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime