Replace compaction notifications with system notifications (#5218)

This commit is contained in:
David Katz
2025-10-22 16:09:44 -04:00
committed by GitHub
parent 755e9f893d
commit 23412e270f
31 changed files with 350 additions and 1060 deletions
@@ -90,7 +90,7 @@ pub fn format_messages(messages: &[Message]) -> Vec<Value> {
MessageContent::ToolConfirmationRequest(_tool_confirmation_request) => {
// Skip tool confirmation requests
}
MessageContent::ConversationCompacted(_) => {
MessageContent::SystemNotification(_) => {
// Skip
}
MessageContent::Thinking(thinking) => {
@@ -48,8 +48,8 @@ pub fn to_bedrock_message_content(content: &MessageContent) -> Result<bedrock::C
// Redacted thinking blocks are not supported in Bedrock - skip
bedrock::ContentBlock::Text("".to_string())
}
MessageContent::ConversationCompacted(_) => {
bail!("SummarizationRequested should not get passed to the provider")
MessageContent::SystemNotification(_) => {
bail!("SystemNotification should not get passed to the provider")
}
MessageContent::ToolRequest(tool_req) => {
let tool_use_id = tool_req.id.to_string();
@@ -128,7 +128,7 @@ fn format_messages(messages: &[Message], image_format: &ImageFormat) -> Vec<Data
}
}
}
MessageContent::ConversationCompacted(_) => {
MessageContent::SystemNotification(_) => {
continue;
}
MessageContent::ToolResponse(response) => {
+1 -1
View File
@@ -96,7 +96,7 @@ pub fn format_messages(messages: &[Message], image_format: &ImageFormat) -> Vec<
// Redacted thinking blocks are not directly used in OpenAI format
continue;
}
MessageContent::ConversationCompacted(_) => {
MessageContent::SystemNotification(_) => {
continue;
}
MessageContent::ToolRequest(request) => match &request.tool_call {
@@ -53,7 +53,7 @@ pub fn format_messages(messages: &[Message]) -> Vec<Value> {
MessageContent::ToolConfirmationRequest(_) => {
// Skip tool confirmation requests
}
MessageContent::ConversationCompacted(_) => {
MessageContent::SystemNotification(_) => {
// Skip
}
MessageContent::Thinking(_thinking) => {