Make Codex HTTP identity explicit

This commit is contained in:
Owen Lin
2026-05-19 13:54:51 -07:00
parent 05b8ce4354
commit caaae96609
49 changed files with 476 additions and 303 deletions
+3 -1
View File
@@ -9,6 +9,7 @@ use codex_api::SharedAuthProvider;
use codex_client::build_reqwest_client_with_custom_ca;
use codex_client::with_chatgpt_cloudflare_cookie_store;
use codex_login::CodexAuth;
use codex_login::default_client::Originator;
use codex_login::default_client::get_codex_user_agent;
use codex_protocol::account::PlanType as AccountPlanType;
use codex_protocol::protocol::CreditsSnapshot;
@@ -170,8 +171,9 @@ impl Client {
}
pub fn from_auth(base_url: impl Into<String>, auth: &CodexAuth) -> Result<Self> {
let originator = Originator::process_default();
Ok(Self::new(base_url)?
.with_user_agent(get_codex_user_agent())
.with_user_agent(get_codex_user_agent(&originator))
.with_auth_provider(codex_model_provider::auth_provider_from_auth(auth)))
}