[codex] cover app-owned HTTP requests [ci changed_files]

This commit is contained in:
Cooper Gamble
2026-06-03 23:44:25 +00:00
parent ec2e111e04
commit d766866d3c
52 changed files with 1415 additions and 358 deletions
+9
View File
@@ -4,6 +4,7 @@ use std::sync::Arc;
use codex_api::Provider;
use codex_api::SharedAuthProvider;
use codex_http_state::HttpStateSurface;
use codex_login::AuthManager;
use codex_login::CodexAuth;
use codex_model_provider_info::ModelProviderInfo;
@@ -112,6 +113,14 @@ pub trait ModelProvider: fmt::Debug + Send + Sync {
/// Returns the current provider-scoped auth value, if one is configured.
async fn auth(&self) -> Option<CodexAuth>;
/// Returns the current provider-scoped auth value and attributes any refresh to `surface`.
async fn auth_for_surface(&self, surface: HttpStateSurface) -> Option<CodexAuth> {
match self.auth_manager() {
Some(auth_manager) => auth_manager.auth_for_surface(surface).await,
None => self.auth().await,
}
}
/// Returns the current app-visible account state for this provider.
fn account_state(&self) -> ProviderAccountResult;