idle, including across multiple model exchanges and tool invocations.
session/prompt only lasts until the Agent accepts the prompt. The Agent reports the accepted user message, running state, output, and completion through session/update notifications.
Before sending prompts, Clients MUST first complete the initialization phase and session setup.
Prompt Lifecycle
A typical prompt-driven flow enables rich interactions between the user, Agent, and any connected tools.1. User Message
The Client sends a user message withsession/prompt:
The contents of the user message, e.g. text, images, files, etc.Clients MUST restrict types of content according to the Prompt Capabilities established during initialization.
Learn more about Content
2. Prompt Accepted
Upon receiving a prompt request, the Agent MUST respond once it has accepted the prompt. The response body is empty because completion is reported throughstate_update notifications, not through the session/prompt response:
user_message update with the full content array or streamed user_message_chunk updates. This update is the source of truth for the agent-owned messageId.
3. Agent Reports Output
When foreground work starts or resumes, the Agent MUST send astate_update notification with state: "running":
session/update notifications. This may include the Agent’s plan for accomplishing the task:
Learn more about Agent Plans
agent_message update with the full content array:
messageId on message updates and message chunks.
User, agent, and thought messages can each be reported either as a message update with a full content array or as streamed chunks. user_message, agent_message, and agent_thought updates are upserts keyed by messageId: omitted content leaves the existing message content unchanged, content: null clears it, and concrete content arrays replace the previous content. Chunk updates with the same messageId append content; a changed messageId indicates a new message.
Clients apply message updates and chunks in the order they are received for each messageId:
- A message update without
contentleaves the current content unchanged, so Agents can update other optional fields without resending content. - A message update with
contentreplaces all content currently stored for that message, including content accumulated from earlier chunks. - A message update with
content: []orcontent: nullclears the message content. - A chunk appends its
contentto whatever content is current for that message, whether that content came from an earlier message update or earlier chunks. - A chunk’s
_meta, when present, is chunk-scoped.
agent_message with content: [A], then sends agent_message_chunk with B, the rendered message content is [A, B]. If it later sends another agent_message with content: [C], the rendered content becomes [C]; the earlier full content and chunks are replaced. Subsequent chunks append to [C].
For streaming agent text, the Agent can use agent_message_chunk updates:
agent_thought updates patch fields for the same thought messageId; agent_thought_chunk updates append new content.
Session Usage Updates
The Agent MAY also report current session context and cumulative cost state with ausage_update:
used and size are required and non-null token counts for the current session context. cost is optional and, if present, amount and currency are required. currency is an ISO 4217 currency code like "USD".
4. Report Completion
When the Agent is ready to process a new prompt, it MUST reportidle with a state_update notification. When the transition ends foreground work, the Agent MUST include the corresponding StopReason:
state_update session update with the corresponding StopReason.
5. Tool Invocation and Status Reporting
Before proceeding with execution, the Agent MAY request permission from the Client via thesession/request_permission method.
While foreground work is blocked on a permission response or other user action, the Agent SHOULD report requires_action. When work resumes, the Agent SHOULD report running.
Once permission is granted (if required), the Agent SHOULD invoke the tool and report a status update marking the tool as in_progress:
tool_call_content_chunk:
tool_call_content_chunk to the current content for that toolCallId. A later tool_call_update with content replaces the accumulated content.
Display-only terminal bytes use terminal_output_chunk, not
tool_call_content_chunk. See Display-only
Terminals for their
per-terminal byte ordering and snapshot semantics.
While tools execute on the Agent, they MAY leverage Client capabilities negotiated during initialization.
When the tool completes, the Agent sends another update with the final status and any content:
Learn more about Tool Calls
6. Continue Conversation
The Agent sends the tool results back to the language model as another request. The cycle returns to step 3, continuing until the language model completes its response without requesting additional tool calls or foreground work is stopped by the Agent or cancelled by the Client.Stop Reasons
When an Agent stops foreground work, it must specify the correspondingStopReason on an idle state_update session update:
end_turn
The Agent has no more work to perform after the language model finishes
responding without requesting more tools
max_tokens
The maximum token limit is reached
max_turn_requests
The maximum number of model requests for the foreground work is exceeded
refusal
The Agent refuses to continue
cancelled
The Client cancels active work
_; unknown non-underscore stop reasons are reserved for future ACP variants.
Session States
state_update reports foreground work.
running
Foreground work is in progress.
idle
The Agent is ready to process a new prompt.
requires_action
Foreground work is blocked on user action.
session/update notifications while the Agent reports idle. These notifications do not change the state.
Cancellation
Clients MAY cancel active session work at any time by sending asession/cancel notification:
cancelled as soon as it sends the session/cancel notification.
The Client MUST respond to all pending session/request_permission requests with the cancelled outcome.
When the Agent receives this notification, it SHOULD stop all language model requests and all tool call invocations as soon as possible.
After all ongoing operations have been successfully aborted and pending updates have been sent, the Agent MUST send an idle state_update session update with the cancelled stop reason.
The Agent MAY send session/update notifications with content or tool call updates after receiving the session/cancel notification, but it MUST ensure that it does so before sending the idle state_update session update that reports cancellation.
The Client SHOULD still accept tool call updates received after sending session/cancel.
After the Agent reports
idle, the Client may send another session/prompt to continue the conversation, building on the established session context.