Skip to content

Commit 6fdae86

Browse files
committed
docs(rfd): Move session/close to Preview
1 parent db1f4dc commit 6fdae86

File tree

7 files changed

+90
-10
lines changed

7 files changed

+90
-10
lines changed

docs/docs.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,14 @@
128128
"rfds/diff-delete",
129129
"rfds/boolean-config-option",
130130
"rfds/elicitation",
131-
"rfds/session-close",
132131
"rfds/next-edit-suggestions",
133132
"rfds/additional-directories",
134133
"rfds/custom-llm-endpoint"
135134
]
136135
},
137136
{
138137
"group": "Preview",
139-
"pages": []
138+
"pages": ["rfds/session-close"]
140139
},
141140
{
142141
"group": "Completed",

docs/protocol/draft/schema.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ This capability is not part of the spec yet, and may be removed or changed at an
671671

672672
Closes an active session and frees up any resources associated with it.
673673

674-
This method is only available if the agent advertises the `session.close` capability.
674+
This method is only available if the agent advertises the `sessionCapabilities.close` capability.
675675

676676
The agent must cancel any ongoing work (as if `session/cancel` was called)
677677
and then free up any resources associated with the session.
@@ -688,7 +688,7 @@ If supported, the agent **must** cancel any ongoing work related to the session
688688
(treat it as if `session/cancel` was called) and then free up any resources
689689
associated with the session.
690690

691-
Only available if the Agent supports the `session.close` capability.
691+
Only available if the Agent supports the `sessionCapabilities.close` capability.
692692

693693
**Type:** Object
694694

docs/protocol/draft/session-setup.mdx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,79 @@ When **all** the conversation entries have been streamed to the Client, the Agen
178178

179179
The Client can then continue sending prompts as if the session was never interrupted.
180180

181+
## Closing Active Sessions
182+
183+
<Note>
184+
This section describes the preview `sessionCapabilities.close` capability.
185+
Clients MUST gate usage on that capability being present during
186+
initialization.
187+
</Note>
188+
189+
When advertised, Clients MAY call `session/close` to tell the Agent to cancel
190+
any ongoing work for a session and free any resources associated with that
191+
active session.
192+
193+
### Checking Support
194+
195+
Before attempting to close a session, Clients **MUST** verify that the Agent
196+
supports this capability by checking the `sessionCapabilities.close` field in
197+
the `initialize` response:
198+
199+
```json highlight={8-10}
200+
{
201+
"jsonrpc": "2.0",
202+
"id": 0,
203+
"result": {
204+
"protocolVersion": 1,
205+
"agentCapabilities": {
206+
"sessionCapabilities": {
207+
"close": {}
208+
}
209+
}
210+
}
211+
}
212+
```
213+
214+
If `sessionCapabilities.close` is not present, the Agent does not support
215+
closing sessions and Clients **MUST NOT** attempt to call `session/close`.
216+
217+
### Closing a Session
218+
219+
To close an active session, Clients **MUST** call the `session/close` method
220+
with the session ID:
221+
222+
```json
223+
{
224+
"jsonrpc": "2.0",
225+
"id": 2,
226+
"method": "session/close",
227+
"params": {
228+
"sessionId": "sess_789xyz"
229+
}
230+
}
231+
```
232+
233+
<ParamField path="sessionId" type="SessionId" required>
234+
The ID of the active session to close.
235+
</ParamField>
236+
237+
The Agent **MUST** cancel any ongoing work for that session as if
238+
[`session/cancel`](../prompt-turn#cancellation) had been called, then free the
239+
resources associated with the session.
240+
241+
On success, the Agent responds with an empty result object:
242+
243+
```json
244+
{
245+
"jsonrpc": "2.0",
246+
"id": 2,
247+
"result": {}
248+
}
249+
```
250+
251+
Agents MAY return an error if the session does not exist or is not currently
252+
active.
253+
181254
## Additional Workspace Roots
182255

183256
<Note>

docs/rfds/session-close.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Clients can track what sessions are actively used by a user and automatically cl
4444
> Tell me more about your implementation. What is your detailed implementation plan?
4545
4646
We propose to add a new `"session/close"` method. Agents must declare this option is
47-
available by returning `session: { close : {} }` in their capabilities. The object is reserved
48-
to declare future capabilities.
47+
available by returning `sessionCapabilities: { close: {} }` in their capabilities. The object is
48+
reserved to declare future capabilities.
4949

5050
Then the client would be able to close a specific session with:
5151

@@ -76,5 +76,6 @@ seems like a good idea.
7676

7777
## Revision history
7878

79+
2026-04-14: Move to preview and update capability docs to `sessionCapabilities.close`
7980
2026-03-09: Rename from session/stop to session/close
8081
2026-02-24: Initial draft

docs/rfds/updates.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ rss: true
66

77
This page tracks lifecycle changes for ACP Requests for Dialog. For broader ACP announcements, see [Updates](/updates).
88

9+
<Update label="April 14, 2026" tags={["Preview"]}>
10+
## session/close RFD moves to Preview stage
11+
12+
The RFD for allowing agents to close a given session has been moved to Preview stage. Please review the [RFD](/rfds/session-close) for more information on the current proposal and provide feedback before the feature is stabilized.
13+
14+
</Update>
15+
916
<Update label="March 27, 2026" tags={["Draft"]}>
1017
## Custom LLM Endpoint RFD moves to Draft stage
1118

schema/schema.unstable.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@
11851185
"$ref": "#/$defs/CloseSessionRequest"
11861186
}
11871187
],
1188-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCloses an active session and frees up any resources associated with it.\n\nThis method is only available if the agent advertises the `session.close` capability.\n\nThe agent must cancel any ongoing work (as if `session/cancel` was called)\nand then free up any resources associated with the session.",
1188+
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nCloses an active session and frees up any resources associated with it.\n\nThis method is only available if the agent advertises the `sessionCapabilities.close` capability.\n\nThe agent must cancel any ongoing work (as if `session/cancel` was called)\nand then free up any resources associated with the session.",
11891189
"title": "CloseSessionRequest"
11901190
},
11911191
{
@@ -1422,7 +1422,7 @@
14221422
"x-side": "agent"
14231423
},
14241424
"CloseSessionRequest": {
1425-
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for closing an active session.\n\nIf supported, the agent **must** cancel any ongoing work related to the session\n(treat it as if `session/cancel` was called) and then free up any resources\nassociated with the session.\n\nOnly available if the Agent supports the `session.close` capability.",
1425+
"description": "**UNSTABLE**\n\nThis capability is not part of the spec yet, and may be removed or changed at any point.\n\nRequest parameters for closing an active session.\n\nIf supported, the agent **must** cancel any ongoing work related to the session\n(treat it as if `session/cancel` was called) and then free up any resources\nassociated with the session.\n\nOnly available if the Agent supports the `sessionCapabilities.close` capability.",
14261426
"properties": {
14271427
"_meta": {
14281428
"additionalProperties": true,

src/agent.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,7 @@ impl ResumeSessionResponse {
16061606
/// (treat it as if `session/cancel` was called) and then free up any resources
16071607
/// associated with the session.
16081608
///
1609-
/// Only available if the Agent supports the `session.close` capability.
1609+
/// Only available if the Agent supports the `sessionCapabilities.close` capability.
16101610
#[cfg(feature = "unstable_session_close")]
16111611
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
16121612
#[schemars(extend("x-side" = "agent", "x-method" = SESSION_CLOSE_METHOD_NAME))]
@@ -4214,7 +4214,7 @@ pub enum ClientRequest {
42144214
///
42154215
/// Closes an active session and frees up any resources associated with it.
42164216
///
4217-
/// This method is only available if the agent advertises the `session.close` capability.
4217+
/// This method is only available if the agent advertises the `sessionCapabilities.close` capability.
42184218
///
42194219
/// The agent must cancel any ongoing work (as if `session/cancel` was called)
42204220
/// and then free up any resources associated with the session.

0 commit comments

Comments
 (0)