codex: preserve local MCP patch approval shape

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-05-07 19:14:05 -07:00
parent 1f010384df
commit 1943bb005c

View File

@@ -64,10 +64,10 @@ pub(crate) async fn handle_patch_approval_request(
if let Some(r) = &reason {
message_lines.push(r.clone());
}
let codex_environment_id = (!environment_id.is_empty()
&& environment_id != codex_exec_server::LOCAL_ENVIRONMENT_ID)
.then_some(environment_id);
let codex_cwd = cwd;
let include_environment_context =
!environment_id.is_empty() && environment_id != codex_exec_server::LOCAL_ENVIRONMENT_ID;
let codex_environment_id = include_environment_context.then_some(environment_id);
let codex_cwd = include_environment_context.then_some(cwd).flatten();
if let Some(environment_id) = codex_environment_id.as_deref() {
message_lines.push(format!("Environment: {environment_id}"));
}