镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
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
9 changes: 5 additions & 4 deletions agent-client-protocol-schema/src/v1/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3859,17 +3859,18 @@ impl HttpHeader {
pub struct SystemPrompt {
/// How the Agent combines `content` with its own instructions.
///
/// Required on the wire, so every request states its mode. In Rust,
/// Unknown
/// values are preserved. Agents MUST return an error
/// for modes they do not support.
/// Required. Agents MUST return an error for a mode they do not support rather than
/// treating it as `append` or `override`.
pub mode: SystemPromptMode,
/// The system prompt content.
///
/// Agents advertising the capability MUST accept `text` content blocks.
/// Clients MUST NOT send other content block types until a future
/// capability allows them, and Agents MUST return an error for content
/// blocks they do not support.
///
/// Clients MUST NOT send an empty array. Agents MAY reject one with
/// `-32602` without creating, loading, resuming, or forking the session.
pub content: Vec<ContentBlock>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
Expand Down
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 @@ -4062,6 +4062,9 @@ pub struct SystemPrompt {
/// Clients MUST NOT send other content block types until a future
/// capability allows them, and Agents MUST return an error for content
/// blocks they do not support, including unknown types.
///
/// Clients MUST NOT send an empty array. Agents MAY reject one with
/// `-32602` without creating, resuming, or forking the session.
pub content: Vec<ContentBlock>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Omitted and `null` are equivalent and mean no metadata.
Expand Down
3 changes: 1 addition & 2 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
"pages": [
"rfds/streamable-http-websocket-transport",
"rfds/subagents",
"rfds/client-system-prompt",
"rfds/mcp-over-acp",
{
"group": "v2",
Expand All @@ -237,7 +236,7 @@
},
{
"group": "Preview",
"pages": []
"pages": ["rfds/client-system-prompt"]
},
{
"group": "Completed",
Expand Down
9 changes: 5 additions & 4 deletions docs/protocol/v1/draft/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8592,14 +8592,15 @@ Clients MUST NOT send other content block types until a future
capability allows them, and Agents MUST return an error for content
blocks they do not support.

Clients MUST NOT send an empty array. Agents MAY reject one with
`-32602` without creating, loading, resuming, or forking the session.

</ResponseField>
<ResponseField name="mode" type={<a href="#systempromptmode">SystemPromptMode</a>} required>
How the Agent combines `content` with its own instructions.

Required on the wire, so every request states its mode. In Rust,
Unknown
values are preserved. Agents MUST return an error
for modes they do not support.
Required. Agents MUST return an error for a mode they do not support rather than
treating it as `append` or `override`.

</ResponseField>

Expand Down
1 change: 1 addition & 0 deletions docs/protocol/v1/draft/session-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ and, when the Agent supports it, `session/fork`.
- `append` adds `content` to the Agent's own instructions rather than replacing them. The Agent **SHOULD** give it system-level precedence, for example in the model's system prompt or developer instructions rather than in user-turn content. Where it is placed and how it is formatted is up to the Agent
- `override` replaces the Agent's built-in default instructions. It does not change tool availability, MCP servers, permissions, or session configuration. Context the Agent supplies from the workspace or environment, such as `AGENTS.md` files or skill listings, **MAY** still be included, and Agents **SHOULD** document what they keep. Clients that use `override` take responsibility for any tool guidance or safety instructions the Agent's default instructions provided
- only `text` content blocks are supported for now: Agents **MUST** accept them, and Clients **MUST NOT** send other content block types until a future capability allows them
- Clients **MUST NOT** send an empty `content` array. Agents **MAY** reject one with `-32602` without creating, loading, 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/load`, `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, load, resume, or fork the session. JSON-RPC `-32602` (Invalid params) is the **RECOMMENDED** error for malformed or unsupported values
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 @@ -9637,6 +9637,9 @@ Clients MUST NOT send other content block types until a future
capability allows them, and Agents MUST return an error for content
blocks they do not support, including unknown types.

Clients MUST NOT send an empty array. Agents MAY reject one with
`-32602` without creating, resuming, or forking the session.

</ResponseField>
<ResponseField name="mode" type={<a href="#systempromptmode">SystemPromptMode</a>} required>
How the Agent combines `content` with its own instructions.
Expand Down
1 change: 1 addition & 0 deletions docs/protocol/v2/draft/session-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ Agent supports it, `session/fork`.
- `append` adds `content` to the Agent's own instructions rather than replacing them. The Agent **SHOULD** give it system-level precedence, for example in the model's system prompt or developer instructions rather than in user-turn content. Where it is placed and how it is formatted is up to the Agent
- `override` replaces the Agent's built-in default instructions. It does not change tool availability, MCP servers, permissions, or session configuration. Context the Agent supplies from the workspace or environment, such as `AGENTS.md` files or skill listings, **MAY** still be included, and Agents **SHOULD** document what they keep. Clients that use `override` take responsibility for any tool guidance or safety instructions the Agent's default instructions provided
- only `text` content blocks are supported for now: Agents **MUST** accept them, and Clients **MUST NOT** send other content block types until a future capability allows them. Agents **MUST** return an error for content blocks they do not support, including unknown types
- 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
Expand Down
Loading
Loading