Chat with an agent
An agent user wants to start a conversation with an agent, send messages and read the reply as it is written.

As an agent user, I want to start a conversation with my agent and read its reply as it is written, so that I can get work done from my phone as naturally as texting.

Situation

I have an agent and I am on its detail screen. I have a question or a task in mind.

What I do

    Tap "New conversation".

    Tap the field at the bottom and type my message.

    Tap the send button.

    Read the reply as it appears, then write the next message.

What I should see

    A new conversation opens as an Agent session that is empty except for "New chat" and "Say something to start this conversation."

    At the bottom is a rounded field with the hint "Message" and a round send button. Its border turns the brand colour while I type in it.

    The send button is dimmed while the field is empty or holds only spaces.

    The field grows as I write more lines, up to a limit, then scrolls.

    When I tap send, my message appears at once as a bubble on the right in the brand colour, before the server has confirmed it.

    The keyboard stays up and the cursor stays in the field.

    When the server accepts the message the field empties and the conversation scrolls to its end.

    A line at the end reads "Thinking…", then "Running a tool…" or "Replying…", with "Stop" beside it, while the agent works.

    The agent's reply grows in a grey bubble on the left as it is written, and stays there when finished.

    Replies are shown as formatted text: bold, lists, code and links are drawn, not raw symbols.

    The send button is dimmed while a message is being sent, so nothing is sent twice.

    The title in the bar starts as "Conversation" and changes when the server names the conversation.

    The conversation follows the newest row as long as I stay at the end.

When something goes wrong

    If sending fails, my bubble goes away, my text is still in the field, and a red line at the end of the conversation gives the reason with "Retry". I tap send again. The message then appears once, not twice.

    If the agent's reply fails part way, see Steer a run.

Not included

    I can send text only. There are no photos, files or voice.

    I cannot edit or delete a message, or rename or delete a conversation.

    I cannot change the agent's model from inside a conversation.

    A draft I did not send is not kept when I leave the conversation.

Trace

Story US-AGENT-05, 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

The conversation screen: transcript, status line, composer

Session timeline

Row kinds and their order, including sending and streaming rows

Chat messages and the streaming reply

My bubble, the agent's bubble, the sending and streaming bubbles

Agents composer

The message field and send button

Composers

The shared composer pattern

The three composers compared

How this composer differs from the comment composers

Agent detail

New conversation, where a chat starts

EmptyState

New chat, before the first message

AgentError

The failure line after a failed send

States for every screen

Loading, empty, sending and failed states of the session

How the framework shaped the design

The chat thread recipe the screen follows

Honest state: loading, failure and empty

A failed send keeps the draft and removes the bubble

Color and tokens

Brand fill means mine

Roles, headings and labels

Labels on the field and send button

Implementation

Page

Part it plays

Agents: screens and components

AgentSessionScreen, the timeline derivations and composer

Agents: WebSocket streams as resources

The session stream: appended events, partial text, phase and status

Agents: chat rows and run cards

chatRows: session events to bubbles

Agents: reads, commands and the clock

agentsSession, create-session and send commands, caller clock for writes

Agents: signed action envelope and endpoints

Signed MessageSession and Subscribe envelopes

Agents: chat with Seed agents

Snapshot plus stream data flow

Agents server

CreateSession, MessageSession, GetSession and the WebSocket frames

Root declarations: Activity and Agents

agentsDraft, agentsOptimistic, agentsThread, agentsChanged, agentsVisibleOptimistic

Navigation and routes

The session route

State, refresh and stale-reply patterns

Optimistic row and the owner stamp on the thread

Contract views and built-in calls

Markdown text, virtualized list that follows its end, retained focus

Where the app yields for the turn budget

Transcript conversion kept linear for long sessions

Contract UI tests

The UI tests of sending and streaming

Mock agents server

Scripted replies, streaming and /dev/reject-next-message

Bun unit tests

Unit tests of transcript replay and timestamps

Code

File

What

agents.contract L470-633

AgentSessionScreen

agents.contract L497-506

Timeline order: history, sending, streaming, tail

agents.contract L580-590

Message bubbles

agents.contract L597-633

Parent line or the composer

app.contract L48-48

session route

app.contract L173-178

agentsThreadData, agentsThread, agentsVisibleOptimistic

app.contract L507-516

agentsNewSession, agentsEdit, agentsSend

app.contract L525-540

agentsAfterChange

app.contract L800-820

AgentSessionScreen wiring

src/agents/sources.ts L261-349

agentsSession and agentsSessionStream

src/agents/sources.ts L460-496

agentsCommand

src/agents/model.ts L111-298

chatRows

Tests

File

What it checks

agents.test.contract

session opens newest and streams markdown, tool results and run status

agents.test.contract

failed sends keep the draft and recover without duplicate user bubbles

agents.test.contract

agents list, configuration, providers and validated creation

src/agents/__tests__/agents.test.ts

transcript and run presentation: replays without duplicate messages and joins tools to results

src/agents/__tests__/review.test.ts

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

src/agents/__tests__/review.test.ts

joining tool results stays linear for long sessions (Hermes 100 ms turn budget)

Delivery

Delivered by #1470.

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

Unsubscribe anytime

Connections0
Linked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkLinked document · Outgoing linkChat with an agentChat with an agent
Citations 0Children & links 36

Loading child documents…

Connections show where other documents or comments link to this document.

Related documents

Loading connections…