backend-client: route requests through HTTP client factory

This commit is contained in:
Michael Bolin
2026-07-09 10:24:15 -07:00
parent 93835d1ed2
commit 080d07d94f
23 changed files with 447 additions and 117 deletions
+1
View File
@@ -19,6 +19,7 @@ chrono = { workspace = true, features = ["serde"] }
codex-api = { workspace = true }
codex-backend-client = { workspace = true }
codex-git-utils = { workspace = true }
codex-http-client = { workspace = true }
serde = { version = "1", features = ["derive"] }
serde_json = { workspace = true }
thiserror = { workspace = true }
+5 -2
View File
@@ -28,9 +28,12 @@ pub struct HttpClient {
}
impl HttpClient {
pub fn new(base_url: impl Into<String>) -> anyhow::Result<Self> {
pub fn new(
base_url: impl Into<String>,
http_client_factory: codex_http_client::HttpClientFactory,
) -> anyhow::Result<Self> {
let base_url = base_url.into();
let backend = backend::Client::new(base_url.clone())?;
let backend = backend::Client::new(base_url.clone(), http_client_factory)?;
Ok(Self { base_url, backend })
}