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
2 changes: 1 addition & 1 deletion docs/protocol/v2/draft/error.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ A receiver that does not implement a method, or receives a capability-gated meth

Malformed parameters and unsupported values get `-32602`. For example, an invalid `session/list` cursor, or in `session/set_config_option` an unknown `configId`, an invalid value, or a value `type` that is unsupported or doesn't match the option.

A `systemPrompt` the Agent cannot apply gets an error, and `-32602` is recommended. See [System prompt](/protocol/v2/draft/session-setup#system-prompt).
A `systemPrompt` with an unadvertised mode, an unsupported content block type, or content that exceeds the Agent's limits gets `-32602`. See [System prompt](/protocol/v2/draft/session-setup#system-prompt).

### Unknown sessions

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 @@ -563,7 +563,7 @@ Agent supports it, `session/fork`.
- Clients **MUST NOT** send an empty `content` array. Agents **MAY** reject one with `-32602` without creating, resuming, or forking the session
- omitting the field or setting it to `null` on `session/new` means the Agent uses its default instructions
- on `session/resume` and `session/fork`, Clients **SHOULD** send the same `systemPrompt` they used when the session was created. When it is omitted, the Agent may keep a prompt it stored with the session or use its default. When it differs, the Agent **SHOULD** apply it, and **MAY** defer the change until it next rebuilds its prompt (for example, after compaction) when applying it immediately would discard prompt caches or preserved reasoning
- if the Agent cannot apply a supplied `systemPrompt`, for example because of an unadvertised mode, an unsupported content block type, or content that exceeds its limits, it **MUST** return an error and **MUST NOT** create, resume, or fork the session. JSON-RPC `-32602` (Invalid params) is the **RECOMMENDED** error for malformed or unsupported values
- if the Agent cannot apply a supplied `systemPrompt`, it **MUST** return an error and **MUST NOT** create, resume, or fork the session. When the cause is the value itself, such as an unadvertised mode, an unsupported content block type, or content that exceeds its limits, the error **MUST** be `-32602` (Invalid params)

Clients **MUST** only send `systemPrompt` when the Agent advertises `session.systemPrompt`, and **MUST** only use `override` mode when the Agent also advertises `session.systemPrompt.mode.override`:

Expand Down
2 changes: 1 addition & 1 deletion docs/protocol/v2/error.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ A receiver that does not implement a method, or receives a capability-gated meth

Malformed parameters and unsupported values get `-32602`. For example, an invalid `session/list` cursor, or in `session/set_config_option` an unknown `configId`, an invalid value, or a value `type` that is unsupported or doesn't match the option.

A `systemPrompt` the Agent cannot apply gets an error, and `-32602` is recommended. See [System prompt](/protocol/v2/session-setup#system-prompt).
A `systemPrompt` with an unadvertised mode, an unsupported content block type, or content that exceeds the Agent's limits gets `-32602`. See [System prompt](/protocol/v2/session-setup#system-prompt).

### Unknown sessions

Expand Down
1 change: 1 addition & 0 deletions docs/protocol/v2/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ Several error rules that were SHOULD in v1 are MUST in v2, and v2 adds one. Agen
- respond with `-32601` to a method they don't implement, or to a capability-gated method they didn't advertise
- respond with `-32002`, with `data.sessionId`, to a session-scoped request for a session that doesn't exist or isn't active on the connection
- reject a request other than `initialize` that arrives before initialization completes with `-32600`, and also an `initialize` repeated after another request
- reject a `systemPrompt` with an unadvertised mode, an unsupported content block type, or content that exceeds the Agent's limits with `-32602`

See [Errors](/protocol/v2/error).

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 @@ -550,7 +550,7 @@ system-level instructions on `session/new` and `session/resume`.
- Clients **MUST NOT** send an empty `content` array. Agents **MAY** reject one with `-32602` without creating or resuming the session
- omitting the field or setting it to `null` on `session/new` means the Agent uses its default instructions
- on `session/resume`, Clients **SHOULD** send the same `systemPrompt` they used when the session was created. When it is omitted, the Agent may keep a prompt it stored with the session or use its default. When it differs, the Agent **SHOULD** apply it, and **MAY** defer the change until it next rebuilds its prompt (for example, after compaction) when applying it immediately would discard prompt caches or preserved reasoning
- if the Agent cannot apply a supplied `systemPrompt`, for example because of an unadvertised mode, an unsupported content block type, or content that exceeds its limits, it **MUST** return an error and **MUST NOT** create or resume the session. JSON-RPC `-32602` (Invalid params) is the **RECOMMENDED** error for malformed or unsupported values
- if the Agent cannot apply a supplied `systemPrompt`, it **MUST** return an error and **MUST NOT** create or resume the session. When the cause is the value itself, such as an unadvertised mode, an unsupported content block type, or content that exceeds its limits, the error **MUST** be `-32602` (Invalid params)

Clients **MUST** only send `systemPrompt` when the Agent advertises `session.systemPrompt`, and **MUST** only use `override` mode when the Agent also advertises `session.systemPrompt.mode.override`:

Expand Down
Loading