Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions agent-client-protocol-schema/src/v2/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,9 @@ impl NewSessionRequest {
/// Updates may arrive before or after this response. Clients MUST NOT overwrite
/// an already-reported state when the response arrives.
///
/// An Agent whose new session is not `idle` MUST send the session's
/// `state_update` after this response.
///
/// See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/session-setup#creating-a-session)
#[serde_as]
#[skip_serializing_none]
Expand Down
1 change: 1 addition & 0 deletions docs/protocol/v2/draft/prompt-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,7 @@ New sessions default to `idle` until a state update reports otherwise. State
updates may arrive before or after the `session/new` response. Clients
**MUST NOT** overwrite an already-reported state when the response arrives.
A separate initial idle notification is optional and does not represent completion.
An Agent whose new session is not `idle` sends that state after the response. See [Initial session state](/protocol/v2/draft/session-setup#initial-session-state).

`session/resume` does not imply `idle`. The Agent **MUST** send a snapshot of
foreground state after resuming, following any requested history replay and
Expand Down
3 changes: 3 additions & 0 deletions docs/protocol/v2/draft/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,9 @@ New sessions default to `idle` until a state update reports otherwise.
Updates may arrive before or after this response. Clients MUST NOT overwrite
an already-reported state when the response arrives.

An Agent whose new session is not `idle` MUST send the session's
`state_update` after this response.

See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)

**Type:** Object
Expand Down
2 changes: 1 addition & 1 deletion docs/protocol/v2/draft/session-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ may arrive before or after the `session/new` response. Clients **MUST NOT**
overwrite an already-reported state when the response arrives. An optional
initial idle notification is a snapshot, not a completed turn.

Agents **SHOULD** put initial state in the `session/new` response rather than sending notifications before it. For `configOptions` and `availableCommands`, the response is required, as described below. Agents **SHOULD NOT** send session-scoped requests, such as permission requests or elicitations, before the response, because the Client cannot yet show them for that session. While a `session/new` is pending, Clients **MAY** buffer notifications for a `sessionId` they don't recognize and apply them in order once the response arrives, or drop them. Agents cannot rely on such notifications being seen.
Agents **SHOULD** put initial state in the `session/new` response rather than sending notifications before it. For `configOptions` and `availableCommands`, the response is required, as described below. Agents **SHOULD NOT** send session-scoped requests, such as permission requests or elicitations, before the response, because the Client cannot yet show them for that session. While a `session/new` is pending, Clients **MAY** buffer notifications for a `sessionId` they don't recognize and apply them in order once the response arrives, or drop them. Agents cannot rely on such notifications being seen. An Agent whose new session is not `idle`, for example because it started work when the session was created, **MUST** send the session's `state_update` after the response.

`session/resume` does not imply idle: an existing session may still be running
or waiting for user action. See [Current-State Synchronization](#current-state-synchronization).
Expand Down
1 change: 1 addition & 0 deletions docs/protocol/v2/prompt-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ New sessions default to `idle` until a state update reports otherwise. State
updates may arrive before or after the `session/new` response. Clients
**MUST NOT** overwrite an already-reported state when the response arrives.
A separate initial idle notification is optional and does not represent completion.
An Agent whose new session is not `idle` sends that state after the response. See [Initial session state](/protocol/v2/session-setup#initial-session-state).

`session/resume` does not imply `idle`. The Agent **MUST** send a snapshot of
foreground state after resuming, following any requested history replay and
Expand Down
3 changes: 3 additions & 0 deletions docs/protocol/v2/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ New sessions default to `idle` until a state update reports otherwise.
Updates may arrive before or after this response. Clients MUST NOT overwrite
an already-reported state when the response arrives.

An Agent whose new session is not `idle` MUST send the session's
`state_update` after this response.

See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/session-setup#creating-a-session)

**Type:** Object
Expand Down
2 changes: 1 addition & 1 deletion docs/protocol/v2/session-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ may arrive before or after the `session/new` response. Clients **MUST NOT**
overwrite an already-reported state when the response arrives. An optional
initial idle notification is a snapshot, not a completed turn.

Agents **SHOULD** put initial state in the `session/new` response rather than sending notifications before it. For `configOptions` and `availableCommands`, the response is required, as described below. Agents **SHOULD NOT** send session-scoped requests, such as permission requests or elicitations, before the response, because the Client cannot yet show them for that session. While a `session/new` is pending, Clients **MAY** buffer notifications for a `sessionId` they don't recognize and apply them in order once the response arrives, or drop them. Agents cannot rely on such notifications being seen.
Agents **SHOULD** put initial state in the `session/new` response rather than sending notifications before it. For `configOptions` and `availableCommands`, the response is required, as described below. Agents **SHOULD NOT** send session-scoped requests, such as permission requests or elicitations, before the response, because the Client cannot yet show them for that session. While a `session/new` is pending, Clients **MAY** buffer notifications for a `sessionId` they don't recognize and apply them in order once the response arrives, or drop them. Agents cannot rely on such notifications being seen. An Agent whose new session is not `idle`, for example because it started work when the session was created, **MUST** send the session's `state_update` after the response.

`session/resume` does not imply idle: an existing session may still be running
or waiting for user action. See [Current-State Synchronization](#current-state-synchronization).
Expand Down
2 changes: 1 addition & 1 deletion schema/v2/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3478,7 +3478,7 @@
"x-method": "auth/logout"
},
"NewSessionResponse": {
"description": "Response from creating a new session.\n\nNew sessions default to `idle` until a state update reports otherwise.\nUpdates may arrive before or after this response. Clients MUST NOT overwrite\nan already-reported state when the response arrives.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/session-setup#creating-a-session)",
"description": "Response from creating a new session.\n\nNew sessions default to `idle` until a state update reports otherwise.\nUpdates may arrive before or after this response. Clients MUST NOT overwrite\nan already-reported state when the response arrives.\n\nAn Agent whose new session is not `idle` MUST send the session's\n`state_update` after this response.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/session-setup#creating-a-session)",
"type": "object",
"properties": {
"sessionId": {
Expand Down
2 changes: 1 addition & 1 deletion schema/v2/schema.unstable.json
Original file line number Diff line number Diff line change
Expand Up @@ -4210,7 +4210,7 @@
"required": ["label"]
},
"NewSessionResponse": {
"description": "Response from creating a new session.\n\nNew sessions default to `idle` until a state update reports otherwise.\nUpdates may arrive before or after this response. Clients MUST NOT overwrite\nan already-reported state when the response arrives.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)",
"description": "Response from creating a new session.\n\nNew sessions default to `idle` until a state update reports otherwise.\nUpdates may arrive before or after this response. Clients MUST NOT overwrite\nan already-reported state when the response arrives.\n\nAn Agent whose new session is not `idle` MUST send the session's\n`state_update` after this response.\n\nSee protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)",
"type": "object",
"properties": {
"sessionId": {
Expand Down
Loading