Drop compaction started/ended notifications

This commit is contained in:
Ahmed Ibrahim
2026-01-27 13:28:15 -08:00
parent 60931c5647
commit 2809b6ee8c
4 changed files with 9 additions and 27 deletions

View File

@@ -598,10 +598,8 @@ server_notification_definitions! {
ReasoningSummaryTextDelta => "item/reasoning/summaryTextDelta" (v2::ReasoningSummaryTextDeltaNotification),
ReasoningSummaryPartAdded => "item/reasoning/summaryPartAdded" (v2::ReasoningSummaryPartAddedNotification),
ReasoningTextDelta => "item/reasoning/textDelta" (v2::ReasoningTextDeltaNotification),
CompactionStarted => "thread/compactionStarted" (v2::CompactionStartedNotification),
CompactionEnded => "thread/compactionEnded" (v2::CompactionEndedNotification),
/// Deprecated: use "thread/compactionEnded".
ContextCompacted => "thread/compacted" (v2::CompactionEndedNotification),
/// Deprecated: use the compaction item lifecycle.
ContextCompacted => "thread/compacted" (v2::ContextCompactedNotification),
DeprecationNotice => "deprecationNotice" (v2::DeprecationNoticeNotification),
ConfigWarning => "configWarning" (v2::ConfigWarningNotification),

View File

@@ -2362,23 +2362,7 @@ pub struct WindowsWorldWritableWarningNotification {
pub failed_scan: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct CompactionStartedNotification {
pub thread_id: String,
pub turn_id: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct CompactionEndedNotification {
pub thread_id: String,
pub turn_id: String,
}
/// Deprecated: use `CompactionEndedNotification`.
/// Deprecated: use the compaction item lifecycle.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]

View File

@@ -23,7 +23,7 @@ use codex_app_server_protocol::CommandExecutionOutputDeltaNotification;
use codex_app_server_protocol::CommandExecutionRequestApprovalParams;
use codex_app_server_protocol::CommandExecutionRequestApprovalResponse;
use codex_app_server_protocol::CommandExecutionStatus;
use codex_app_server_protocol::CompactionEndedNotification;
use codex_app_server_protocol::ContextCompactedNotification;
use codex_app_server_protocol::DeprecationNoticeNotification;
use codex_app_server_protocol::DynamicToolCallParams;
use codex_app_server_protocol::ErrorNotification;
@@ -622,7 +622,7 @@ pub(crate) async fn apply_bespoke_event_handling(
outgoing
.send_server_notification(ServerNotification::ItemCompleted(completed))
.await;
let legacy = CompactionEndedNotification {
let legacy = ContextCompactedNotification {
thread_id: conversation_id.to_string(),
turn_id: event_turn_id.clone(),
};

View File

@@ -2,7 +2,7 @@ use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::ClientInfo;
use codex_app_server_protocol::CompactionEndedNotification;
use codex_app_server_protocol::ContextCompactedNotification;
use codex_app_server_protocol::ItemCompletedNotification;
use codex_app_server_protocol::ItemStartedNotification;
use codex_app_server_protocol::JSONRPCNotification;
@@ -106,7 +106,7 @@ async fn compaction_emits_item_lifecycle_and_legacy_completion_notification() ->
turn_id: turn_id.clone(),
item: ThreadItem::Compaction { id: compaction_id },
};
let expected_legacy = CompactionEndedNotification {
let expected_legacy = ContextCompactedNotification {
thread_id: thread.id.clone(),
turn_id,
};
@@ -146,12 +146,12 @@ async fn read_compaction_item_completed(mcp: &mut McpProcess) -> Result<ItemComp
async fn read_legacy_compacted_notification(
mcp: &mut McpProcess,
) -> Result<CompactionEndedNotification> {
) -> Result<ContextCompactedNotification> {
let notification: JSONRPCNotification = mcp
.read_stream_until_notification_message("thread/compacted")
.await?;
let params = notification.params.expect("thread/compacted params");
let legacy: CompactionEndedNotification = serde_json::from_value(params)?;
let legacy: ContextCompactedNotification = serde_json::from_value(params)?;
Ok(legacy)
}