From 6a0f709cff9af480045adc9700c85039fd4c88f0 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Thu, 14 Aug 2025 16:09:12 -0700 Subject: [PATCH] fix: add call_id to ApprovalParams in mcp-server/src/wire_format.rs (#2322) Clients still need this field. --- codex-rs/mcp-server/src/codex_message_processor.rs | 6 ++++-- codex-rs/mcp-server/src/wire_format.rs | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/codex-rs/mcp-server/src/codex_message_processor.rs b/codex-rs/mcp-server/src/codex_message_processor.rs index a13f0f26..2495feb9 100644 --- a/codex-rs/mcp-server/src/codex_message_processor.rs +++ b/codex-rs/mcp-server/src/codex_message_processor.rs @@ -306,13 +306,14 @@ async fn apply_bespoke_event_handling( let Event { id: event_id, msg } = event; match msg { EventMsg::ApplyPatchApprovalRequest(ApplyPatchApprovalRequestEvent { - call_id: _, + call_id, changes, reason, grant_root, }) => { let params = ApplyPatchApprovalParams { conversation_id, + call_id, file_changes: changes, reason, grant_root, @@ -327,13 +328,14 @@ async fn apply_bespoke_event_handling( }); } EventMsg::ExecApprovalRequest(ExecApprovalRequestEvent { - call_id: _, + call_id, command, cwd, reason, }) => { let params = ExecCommandApprovalParams { conversation_id, + call_id, command, cwd, reason, diff --git a/codex-rs/mcp-server/src/wire_format.rs b/codex-rs/mcp-server/src/wire_format.rs index 4a2346cb..95d55e8b 100644 --- a/codex-rs/mcp-server/src/wire_format.rs +++ b/codex-rs/mcp-server/src/wire_format.rs @@ -187,6 +187,9 @@ pub enum ServerRequest { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] pub struct ApplyPatchApprovalParams { pub conversation_id: ConversationId, + /// Use to correlate this with [codex_core::protocol::PatchApplyBeginEvent] + /// and [codex_core::protocol::PatchApplyEndEvent]. + pub call_id: String, pub file_changes: HashMap, /// Optional explanatory reason (e.g. request for extra write access). #[serde(skip_serializing_if = "Option::is_none")] @@ -200,6 +203,9 @@ pub struct ApplyPatchApprovalParams { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] pub struct ExecCommandApprovalParams { pub conversation_id: ConversationId, + /// Use to correlate this with [codex_core::protocol::ExecCommandBeginEvent] + /// and [codex_core::protocol::ExecCommandEndEvent]. + pub call_id: String, pub command: Vec, pub cwd: PathBuf, #[serde(skip_serializing_if = "Option::is_none")]