fix: add call_id to ApprovalParams in mcp-server/src/wire_format.rs (#2322)

Clients still need this field.
This commit is contained in:
Michael Bolin
2025-08-14 16:09:12 -07:00
committed by GitHub
parent 2ecca79663
commit 6a0f709cff
2 changed files with 10 additions and 2 deletions

View File

@@ -306,13 +306,14 @@ async fn apply_bespoke_event_handling(
let Event { id: event_id, msg } = event; let Event { id: event_id, msg } = event;
match msg { match msg {
EventMsg::ApplyPatchApprovalRequest(ApplyPatchApprovalRequestEvent { EventMsg::ApplyPatchApprovalRequest(ApplyPatchApprovalRequestEvent {
call_id: _, call_id,
changes, changes,
reason, reason,
grant_root, grant_root,
}) => { }) => {
let params = ApplyPatchApprovalParams { let params = ApplyPatchApprovalParams {
conversation_id, conversation_id,
call_id,
file_changes: changes, file_changes: changes,
reason, reason,
grant_root, grant_root,
@@ -327,13 +328,14 @@ async fn apply_bespoke_event_handling(
}); });
} }
EventMsg::ExecApprovalRequest(ExecApprovalRequestEvent { EventMsg::ExecApprovalRequest(ExecApprovalRequestEvent {
call_id: _, call_id,
command, command,
cwd, cwd,
reason, reason,
}) => { }) => {
let params = ExecCommandApprovalParams { let params = ExecCommandApprovalParams {
conversation_id, conversation_id,
call_id,
command, command,
cwd, cwd,
reason, reason,

View File

@@ -187,6 +187,9 @@ pub enum ServerRequest {
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct ApplyPatchApprovalParams { pub struct ApplyPatchApprovalParams {
pub conversation_id: ConversationId, 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<PathBuf, FileChange>, pub file_changes: HashMap<PathBuf, FileChange>,
/// Optional explanatory reason (e.g. request for extra write access). /// Optional explanatory reason (e.g. request for extra write access).
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -200,6 +203,9 @@ pub struct ApplyPatchApprovalParams {
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct ExecCommandApprovalParams { pub struct ExecCommandApprovalParams {
pub conversation_id: ConversationId, 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<String>, pub command: Vec<String>,
pub cwd: PathBuf, pub cwd: PathBuf,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]