Skip to content

Commit 140e7ec

Browse files
committed
add agent_message_clear
work with agentclientprotocol/rust-sdk#59 , impls agentclientprotocol#465
1 parent f756975 commit 140e7ec

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

schema/schema.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,6 +2564,17 @@
25642564
"required": ["sessionUpdate"],
25652565
"type": "object"
25662566
},
2567+
{
2568+
"description": "Instructs the client to clear the accumulated streamed content for the current agent message. Subsequent agent_message_chunk updates append from empty. Enables non-monotonic streaming (e.g. reformatting, delegation, iterative refinement).",
2569+
"properties": {
2570+
"sessionUpdate": {
2571+
"const": "agent_message_clear",
2572+
"type": "string"
2573+
}
2574+
},
2575+
"required": ["sessionUpdate"],
2576+
"type": "object"
2577+
},
25672578
{
25682579
"allOf": [
25692580
{

src/client.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ pub enum SessionUpdate {
7777
UserMessageChunk(ContentChunk),
7878
/// A chunk of the agent's response being streamed.
7979
AgentMessageChunk(ContentChunk),
80+
/// Instructs the client to clear the accumulated streamed content for the current agent message.
81+
/// Subsequent `agent_message_chunk` updates append from empty. Enables non-monotonic streaming
82+
/// (e.g. reformatting, delegation, iterative refinement).
83+
/// See protocol docs: [RFD: agent_message_clear](https://github.com/agentclientprotocol/agent-client-protocol/blob/main/docs/rfds/agent_message_clear.md)
84+
AgentMessageClear,
8085
/// A chunk of the agent's internal reasoning being streamed.
8186
AgentThoughtChunk(ContentChunk),
8287
/// Notification that a new tool call has been initiated.

0 commit comments

Comments
 (0)