feat: alias compaction (#7442)

This commit is contained in:
jif-oai
2025-12-02 09:21:30 +00:00
committed by GitHub
parent a8d5ad37b8
commit 85e2fabc9f

View File

@@ -132,6 +132,7 @@ pub enum ResponseItem {
GhostSnapshot {
ghost_commit: GhostCommit,
},
#[serde(alias = "compaction")]
CompactionSummary {
encrypted_content: String,
},
@@ -537,6 +538,7 @@ mod tests {
use anyhow::Result;
use mcp_types::ImageContent;
use mcp_types::TextContent;
use pretty_assertions::assert_eq;
use tempfile::tempdir;
#[test]
@@ -650,6 +652,21 @@ mod tests {
Ok(())
}
#[test]
fn deserializes_compaction_alias() -> Result<()> {
let json = r#"{"type":"compaction","encrypted_content":"abc"}"#;
let item: ResponseItem = serde_json::from_str(json)?;
assert_eq!(
item,
ResponseItem::CompactionSummary {
encrypted_content: "abc".into(),
}
);
Ok(())
}
#[test]
fn roundtrips_web_search_call_actions() -> Result<()> {
let cases = vec![