From 58bb2048ac40dfee881a679cea55aa6e2e9c5902 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Tue, 9 Sep 2025 11:06:59 -0700 Subject: [PATCH] fix: LoginChatGptCompleteNotification does not need to be listed explicitly in protocol-ts (#3222) I verified that the output of `protocol-ts$ cargo run` is unchanged by removing this line.. Added a comment on `ServerNotification` with justification to make this clear. --- codex-rs/protocol-ts/src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/codex-rs/protocol-ts/src/lib.rs b/codex-rs/protocol-ts/src/lib.rs index 5d8d4b17..08cb9407 100644 --- a/codex-rs/protocol-ts/src/lib.rs +++ b/codex-rs/protocol-ts/src/lib.rs @@ -21,6 +21,9 @@ pub fn generate_ts(out_dir: &Path, prettier: Option<&Path>) -> Result<()> { codex_protocol::mcp_protocol::ClientRequest::export_all_to(out_dir)?; codex_protocol::mcp_protocol::ServerRequest::export_all_to(out_dir)?; codex_protocol::mcp_protocol::NewConversationResponse::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::ListConversationsResponse::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::ResumeConversationResponse::export_all_to(out_dir)?; + codex_protocol::mcp_protocol::ArchiveConversationResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::AddConversationSubscriptionResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::RemoveConversationSubscriptionResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::SendUserMessageResponse::export_all_to(out_dir)?; @@ -28,7 +31,6 @@ pub fn generate_ts(out_dir: &Path, prettier: Option<&Path>) -> Result<()> { codex_protocol::mcp_protocol::InterruptConversationResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::GitDiffToRemoteResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::LoginChatGptResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::LoginChatGptCompleteNotification::export_all_to(out_dir)?; codex_protocol::mcp_protocol::CancelLoginChatGptResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::LogoutChatGptResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::GetAuthStatusResponse::export_all_to(out_dir)?; @@ -36,10 +38,10 @@ pub fn generate_ts(out_dir: &Path, prettier: Option<&Path>) -> Result<()> { codex_protocol::mcp_protocol::ExecCommandApprovalResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::GetUserSavedConfigResponse::export_all_to(out_dir)?; codex_protocol::mcp_protocol::GetUserAgentResponse::export_all_to(out_dir)?; + + // All notification types reachable from this enum will be generated by + // induction, so they do not need to be listed individually. codex_protocol::mcp_protocol::ServerNotification::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::ListConversationsResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::ResumeConversationResponse::export_all_to(out_dir)?; - codex_protocol::mcp_protocol::ArchiveConversationResponse::export_all_to(out_dir)?; generate_index_ts(out_dir)?;