- Author(s): @nikita-ashihmin
- Champion: @benbrandt
Elevator pitch
What are you proposing to change?Add a
replay_complete session update to ACP v2. When a Client calls session/resume with a replayFrom cursor, the Agent sends it once, after the last replayed update and before the response. The marker identifies the end of the requested replay, not its start. A child session that the Agent announces during the request gets its own marker on its own sessionId.
With it, a Client can:
- Know when the Agent has finished sending the requested retained history, without waiting for the Agent to finish setup.
- Tell a complete replay from a truncated one when the resume fails, is cancelled, or the connection drops.
Status quo
How do things work today and what problems does this cause? Why would we change things?In v2,
session/resume with replayFrom: { "type": "start" } replays the retained history as session/update notifications. The Agent then synchronizes current state and responds.
Nothing in the stream marks the end of the replay. Two signals follow it, and neither marks the end of the history:
- The current
state_updatesnapshot. It reports the foreground state after resuming, so the Agent can send it only when its setup is done. The Agent sends it only for a successful resume. - The response. It means that the session is active.
- The Client cannot tell when the history is complete. It has the full history but does not know that it is full. It must wait for the snapshot or the response, or guess with a quiet-period timer. A timer is wrong for a paged producer, because a pause between pages looks like the end.
- The Client cannot detect a truncated replay. When a resume fails after part of the replay, the Client does not know whether it got the whole history. A Client that persists the replay can replace a good local copy with a truncated one.
session/load has the same gap. This RFD does not change v1. See Is there a v1 form?
What we propose to do about it
What are you proposing to improve the situation?
The replay_complete update
After the Agent sends every update it selected for a replay, it sends one session/update with the replay_complete variant:
_meta like every other update.
Rules:
- The Agent MUST send
replay_completeexactly once on the session named in eachsession/resumerequest with areplayFromcursor, after the last replayed update and before the response. Child sessions get their own markers. See Subagent sessions. - The Agent MUST send it for an empty replay too. It is then the first
session/updatethe Agent sends for that session after it receives the request. - The Agent MUST NOT send it for a request that does not replay history:
session/resumewithreplayFromomitted ornull, andsession/new. - The Agent MUST NOT send it when it cannot finish the replay.
session/prompt still fails with -32002 until then.
Only history before the marker
From the time the Agent receives the replay request until it sendsreplay_complete, each session/update it sends for that session MUST be replayed history.
The Agent holds every other update for the session in this window and sends it after the marker. Examples are the chunks of a message that is still streaming, notice, available_commands_update, config_option_update, and state_update.
On an already-active session, a live update the Agent sent before it received the request can still be in flight. The Client cannot use the time it sent session/resume to distinguish that update from replay. For example, a live-only user_message can arrive just before the marker for an empty replay.
Current-state synchronization already follows any requested replay, so it follows the marker. This RFD does not change it.
Foreground work that is still running during a resume is split at a cut point. The updates up to the cut are history and come before the marker. The rest comes after it. Chunks are keyed by messageId, so the later chunks append to the replayed message. A replayed tool call whose work is still running keeps its live status, as Replay Contents already allows.
Agent requests such as session/request_permission and elicitation/create are not history, so they SHOULD also wait until after the marker. This includes a pending request that the Agent reestablishes after a connection loss. A Client applies the toolCall of a permission request’s tool_call subject like a tool_call_update, so replayed updates that arrive after the request could overwrite that newer state.
Outcomes
A
session/resume that the Client cancels with $/cancel_request still gets a response. If the Agent cancels it, that is an error response with -32800, and the table applies to it like any other error.
replay_complete means that the Agent sent everything it selected for this replay. It does not mean that the Agent retained all history. Agents SHOULD report known gaps with a mechanism such as a notice, after the marker.
Capabilities
The v2SessionUpdate union is open under the enum variant extension rule. A Client that does not know the variant ignores it and waits for the response, as it does today. The marker needs no Client capability.
The marker is required for Agents that advertise capabilities.session. No Agent capability is needed, and a Client can apply the outcome table to every v2 Agent.
A required update has to be in v2 before v2 is stable. After that, it would need an Agent capability, and a Client could not apply the outcome table to Agents that do not advertise it.
Subagent sessions
A replaying resume of a parent session can also replay child sessions, at any depth. See the Subagent Sessions RFD. Each session has its own marker on its ownsessionId, and the rules of this RFD apply to each session separately:
- The Agent MUST send
replay_completeexactly once on each child session that it announces withsubagent_updatebetween the request and the response. It sends the marker after the announcement and after the last replayed update for that child. An announced child with no replayed history gets a marker too, like the session named in the request. A child that the Agent does not announce gets no marker. - After receiving the resume request, the Agent holds live updates and requests for each announced child until that child’s marker. They do not wait for the replay of any other session.
- The markers of different sessions have no required order. A parent’s marker says nothing about its children.
- The outcome table applies to each session, with that session’s marker and the response to the request.
session/resume response confirms that the Agent finished the replay for the requested session and all the children it included.
A subagent_update is an update for the parent session, so the parent’s marker is the freshness boundary for a child’s work state and capabilities. Those in a replayed subagent_update are historical. Those in a subagent_update after the parent’s marker are current. The Client still waits for the successful response before it sends session/cancel for a child. In v1 the response stays the boundary, as that RFD defines.
Replay cursors
replay_complete means that all entries selected by the replayFrom cursor were sent. For { "type": "start" }, that is all retained history. If a cursor selects no entries, the marker is the first update the Agent sends for the session after receiving the request.
An Agent that rejects the cursor with -32602 replays nothing and sends no marker.
Shiny future
How will things play out once this feature exists?A Client resumes a saved session with replay. When
replay_complete arrives, it knows that the Agent finished sending the retained history requested, even if setup is still in progress. It needs no timer.
If the Agent crashes before sending the marker, the Client knows that the replay was cut short. A Client that persists replayed history keeps its earlier copy.
Implementation details and plan
Tell me more about your implementation. What is your detailed implementation plan?
- Schema. Add a
ReplayCompletevariant with only_metato the v2SessionUpdateunion. - Docs. Update v2 Session Setup. Add a
replay_completestep to the sequence diagram between “All content reported” and the currentstate_update. Document the ordering rule and the outcome table. Add the child markers to the reconnection rules of the Subagent Sessions RFD. Add the variant to the session update table and the resume lifecycle examples in Prompt Lifecycle, to the migration guide, and to the change list in the v2 overview. - SDKs. Expose the variant in the SDKs. An Agent SDK helper can buffer live updates while a replay runs. A Client SDK must deliver the updates of a resuming session before the response. The Client knows the session ID before the request, so the SDK can register the session handler first. kotlin-sdk#146 does this for the Kotlin SDK.
- Adapters. claude-agent-acp already sends one end event after the replay, as a vendor extension in
_metathat the Client opts in to. See #1361. Move it toreplay_completeon v2 connections, and add the marker to the other v2 adapters.
- Steps 1 and 2 are done. They landed on 2026-11-13.
- Step 3 is done for the TypeScript and Rust SDKs. Both expose the variant, and their example Agents send it. The Kotlin SDK delivers a resuming session’s updates before the response since kotlin-sdk#146. Its v2 model does not have the
replay_completevariant yet. - Step 4 is done.
claude-agent-acpandcodex-acpsendreplay_completeon v2 connections.
Frequently asked questions
What questions have arisen over the course of authoring this document or during subsequent discussions?
What alternative approaches did you consider, and why did you settle on this one?
(a) One update after the replay. This RFD proposes it.- It works for an empty history.
- The Agent does not need to know which entry is last. A paged producer sends the marker after its last page.
- It adds one small notification per resume.
- It tells the Client where the replay ends. It does not distinguish an earlier live update already in flight from the first replayed update.
- It separates replayed updates from live ones when they interleave.
- To set the end flag, the Agent must hold back one notification until it knows that no more follow. For a paged producer this adds one page fetch.
- An empty history has no notification for the flag, so it needs design (a) too.
- Positions add bytes to every update, and one JSON-RPC connection is ordered already.
- A success response would no longer confirm that the requested replay finished, so the Client would still need an end marker. This is (a) with a reordered response.
- It broke the freshness boundary that the Subagent Sessions RFD defined at the time, which was the response.
- A prompt could interleave with the history in one stream.
- The slow Agent work still comes before the session is usable.
Why isn’t the current state_update snapshot enough?
Every successful resume already sends a current state_update after any replay and before the response. It does not mark the end of the history:
- The snapshot reports the state after resuming. The Agent knows that state only when its setup is done, which can be seconds after the replay ends. If the Agent had to send the snapshot earlier, it would report a state that it does not know yet.
- The Agent sends the snapshot only for a successful resume. A resume that fails after a complete replay has none.
- The current
tool_call_updateandterminal_updatenotifications for background work come before the snapshot. They use the same variants as replayed history, so the Client cannot tell where the history ends until the snapshot arrives.
replay_complete makes the same split that v2 makes for prompts. There, the session/prompt response is not the idle signal, and a state_update in the stream marks the end of the work. Here, the response means that the session is active, and replay_complete marks the end of the history.
Why a session/update variant and not a new notification method?
SDKs dispatch all session/update notifications through one ordered handler. A separate method can reach the application on another path and lose its order relative to the last replayed update.
Why not let the Agent respond earlier?
Clients rely on the response as the point where the session is active. Some Agent work, such as a CLI start, must finish before the session can take prompts. The two milestones need two signals.What does the Client do with updates after replay_complete but before the response?
They are not replay. The Client applies them as it does after a resume without replay. It still sends session/cancel for a child only after the response succeeds.
Why does each child session get its own marker?
One marker on the parent would have to speak for every session in the tree. The Agent would then hold all live child updates and requests until the whole replay ends, which the Subagent Sessions RFD does not require. With a marker on eachsessionId, a session can resume live delivery as soon as its own replay finishes.
v2 already reports a child’s state_update on the child’s own stream. A Client that handles updates per session finds the end of each history in that session’s stream, without walking the session tree.
The markers have no required order. A rule that the parent’s marker comes last would give one signal for the whole tree, but the parent’s own live updates would then wait for the history of every child. The response is already the point where all selected history has been sent.
Can a Client resume the same session twice at the same time on one connection?
The marker carries thesessionId, not the request ID, so the Client cannot match two markers to two requests. Clients SHOULD NOT send a second session/resume with a replayFrom cursor for a session while the first one is pending.
Does the marker cover session/fork?
No. A future method that replays history should use the same marker.
Is there a v1 form?
Not in this RFD. v1session/load has the same gap, but the v1 SessionUpdate union is closed, and an older Client can fail on an unknown variant. A v1 marker would need two capabilities. An Agent capability tells the Client that a missing marker means a truncated replay. A Client capability tells the Agent that the Client accepts the variant. This could be proposed for v1 separately. Until then, v1 Clients rely on the response or on adapter-specific extensions.
Resolved questions
These were open while the RFD was a draft. They are closed for the v2 Preview.- Name. The update is named
replay_complete. It matches thereplayFromparameter.history_replayedandreplay_endwere considered. - Required or capability? Required, with no capability. With a capability, a Client could not rely on the marker from every v2 Agent.
- Request correlation. The marker does not carry a request identifier. Clients SHOULD NOT send a second replaying
session/resumefor a session while the first one is pending. An optional identifier can be added later. - Resume position. The marker does not carry a cursor. Whether a session cursor can name the point a replay starts from is a question for the RFD that adds partial replay. That RFD can add a
replayFromvariant or an optional field on the marker. - Known gaps. The marker does not carry a flag for incomplete retained history. Agents SHOULD report known gaps after the marker, for example with a session notice. An optional field can be added later. It could only report that history is incomplete, because a marker without it has to keep meaning that the Agent did not say.
Revision history
- 2026-11-20: Moved to Preview with the other v2 RFDs.
- 2026-11-20: Clarified that the marker confirms completion of the requested replay, not retention of every live update. On an already-active session, a live update can cross the resume request without violating the Agent’s ordering rule.
- 2026-11-18: Recorded the status of the implementation plan.
- 2026-11-17: Closed the open questions for the v2 Preview. The update keeps the name
replay_completeand stays required with no capability. The marker carries no request identifier, cursor, or known-gaps flag. Each can be added later as an optional field. The rule against two pending replaying resumes for one session is on the Session Setup page. - 2026-11-17: In v2, the parent’s marker is the freshness boundary for a child’s work state and capabilities. Before, it was the response.
subagent_updateis in the stable v2 schema, so the child session rules are on the stable Session Setup and Subagents pages. - 2026-11-13: Steps 1 and 2 landed.
replay_completeis in the v2 schema asSessionUpdate::ReplayComplete, without a separate feature flag, like the other v2 RFDs. The rules are in the v2 Session Setup page. The child session rules are in its draft copy, becausesubagent_updateis still unstable. - 2026-11-13: Narrowed to v2 and moved into the v2 RFD collection. Added the
state_updatesnapshot and v1 questions. Removed the guidance on when Clients render history. Gave each replayed child session its own marker. - 2026-10-16: Initial draft.