From e0a6d0532deefa65eb7e86287fffadebbfda7591 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 23 Nov 2026 02:23:00 +0000 Subject: [PATCH] Avoid eager copies of plugin startup HTTP response bodies (#63241) ## What changed Convert response bodies with `Vec::from` in both GitHub and public fetches so the conversion can reuse the backing allocation when possible. GitOrigin-RevId: ece0f018a08706a99b80733ec6c916ed39df5213 --- codex-rs/core-plugins/src/startup_sync.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codex-rs/core-plugins/src/startup_sync.rs b/codex-rs/core-plugins/src/startup_sync.rs index ee91e3efe4..27125ecf14 100644 --- a/codex-rs/core-plugins/src/startup_sync.rs +++ b/codex-rs/core-plugins/src/startup_sync.rs @@ -960,7 +960,7 @@ async fn fetch_github_bytes( "{context} from {url} failed with status {status}: {body_text}" )); } - Ok(body.to_vec()) + Ok(Vec::from(body)) } async fn fetch_public_text( @@ -1007,7 +1007,7 @@ async fn fetch_public_bytes( "{context} from {url} failed with status {status}: {body_text}" )); } - Ok(body.to_vec()) + Ok(Vec::from(body)) } fn github_request(http_clients: &StartupSyncHttpClient, url: &str) -> RequestBuilder {