Lightweight coding agent that runs in your terminal
Rust
feat(app-server): add v2 deprecation notice (#8285)
Owen Lind7ae342ff43a
diff --git a/codex-rs/app-server-protocol/src/protocol/common.rs b/codex-rs/app-server-protocol/src/protocol/common.rsindex bd7fd8e28c..83fa53b997 100644--- a/codex-rs/app-server-protocol/src/protocol/common.rs+++ b/codex-rs/app-server-protocol/src/protocol/common.rs@@ -539,6 +539,7 @@ server_notification_definitions! {ReasoningSummaryPartAdded => "item/reasoning/summaryPartAdded" (v2::ReasoningSummaryPartAddedNotification),ReasoningTextDelta => "item/reasoning/textDelta" (v2::ReasoningTextDeltaNotification),ContextCompacted => "thread/compacted" (v2::ContextCompactedNotification),+ DeprecationNotice => "deprecationNotice" (v2::DeprecationNoticeNotification),/// Notifies the user of world-writable directories on Windows, which cannot be protected by the sandbox.WindowsWorldWritableWarning => "windows/worldWritableWarning" (v2::WindowsWorldWritableWarningNotification),diff --git a/codex-rs/app-server-protocol/src/protocol/v2.rs b/codex-rs/app-server-protocol/src/protocol/v2.rsindex 1d58cd1da4..bd1ed62e78 100644--- a/codex-rs/app-server-protocol/src/protocol/v2.rs+++ b/codex-rs/app-server-protocol/src/protocol/v2.rs@@ -1893,6 +1893,16 @@ pub struct AccountLoginCompletedNotification {pub error: Option<String>,}+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]+#[serde(rename_all = "camelCase")]+#[ts(export_to = "v2/")]+pub struct DeprecationNoticeNotification {+ /// Concise summary of what is deprecated.+ pub summary: String,+ /// Optional extra guidance, such as migration steps or rationale.+ pub details: Option<String>,+}+#[cfg(test)]mod tests {use super::*;diff --git a/codex-rs/app-server/src/bespoke_event_handling.rs b/codex-rs/app-server/src/bespoke_event_handling.rsindex dec9d8c089..f7e4f709ee 100644--- a/codex-rs/app-server/src/bespoke_event_handling.rs+++ b/codex-rs/app-server/src/bespoke_event_handling.rs@@ -15,6 +15,7 @@ use codex_app_server_protocol::CommandExecutionRequestApprovalParams;use codex_app_server_protocol::CommandExecutionRequestApprovalResponse;use codex_app_server_protocol::CommandExecutionStatus;use codex_app_server_protocol::ContextCompactedNotification;+use codex_app_server_protocol::DeprecationNoticeNotification;use codex_app_server_protocol::ErrorNotification;use codex_app_server_protocol::ExecCommandApprovalParams;use codex_app_server_protocol::ExecCommandApprovalResponse;@@ -283,6 +284,15 @@ pub(crate) async fn apply_bespoke_event_handling(.send_server_notification(ServerNotification::ContextCompacted(notification)).await;}+ EventMsg::DeprecationNotice(event) => {+ let notification = DeprecationNoticeNotification {+ summary: event.summary,+ details: event.details,+ };+ outgoing+ .send_server_notification(ServerNotification::DeprecationNotice(notification))+ .await;+ }EventMsg::ReasoningContentDelta(event) => {let notification = ReasoningSummaryTextDeltaNotification {thread_id: conversation_id.to_string(),