mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
## What changed Move the model client's request-preparation loop into the shared `prepare_provider_request` helper and add `RequestAuthChange` to classify auth state changes. For managed auth, retry preparation when credentials change and reject account changes, including when the provider starts or stops exposing an auth manager during setup. Capture the auth owner and credential generations together and pass them into the preparation callback so the resulting client setup records the state used for that attempt. ## Testing Add a test verifying that an explicit provider bearer token survives a workspace switch during setup without retrying preparation. GitOrigin-RevId: ed8710d1c344b48ebf6182e25e6269214dd2d3fe
63 lines
2.3 KiB
Rust
63 lines
2.3 KiB
Rust
mod amazon_bedrock;
|
|
mod auth;
|
|
mod bearer_auth_provider;
|
|
mod capabilities;
|
|
mod chatgpt_base_url;
|
|
mod combined_auth;
|
|
mod gcp;
|
|
mod models_endpoint;
|
|
mod models_identity;
|
|
mod provider;
|
|
mod request_preparation;
|
|
mod runtime_auth;
|
|
mod shared_state;
|
|
pub mod test_support;
|
|
mod workspace_routing;
|
|
pub use workspace_routing::ACCOUNT_ROUTING_HEADER;
|
|
pub use workspace_routing::ResolvedResponsesProvider;
|
|
pub use workspace_routing::ResponsesConnectionKey;
|
|
pub use workspace_routing::WorkspaceRoutingContext;
|
|
|
|
pub use amazon_bedrock::is_amazon_bedrock_gov_cloud_region;
|
|
pub use amazon_bedrock::is_supported_amazon_bedrock_region;
|
|
pub use amazon_bedrock::resolve_amazon_bedrock_region;
|
|
pub use auth::AgentIdentitySessionFallback;
|
|
pub use auth::ProviderAuthContext;
|
|
pub use auth::ProviderAuthScope;
|
|
pub use auth::ResolvedProviderAuth;
|
|
pub use auth::auth_provider_from_auth;
|
|
pub use auth::auth_provider_from_auth_manager;
|
|
pub use auth::unauthenticated_auth_provider;
|
|
pub use bearer_auth_provider::BearerAuthProvider;
|
|
pub use bearer_auth_provider::BearerAuthProvider as CoreAuthProvider;
|
|
pub use capabilities::ProviderCapabilities;
|
|
pub use chatgpt_base_url::ChatgptBaseUrl;
|
|
pub use chatgpt_base_url::DEFAULT_CHATGPT_BASE_URL;
|
|
pub use codex_model_provider_info::AMAZON_BEDROCK_PROVIDER_ID;
|
|
pub use codex_model_provider_info::AMAZON_BEDROCK_RUNTIME_PROVIDER_ID;
|
|
pub use codex_model_provider_info::CHATGPT_CODEX_BASE_URL;
|
|
pub use codex_model_provider_info::GCP_PROVIDER_ID;
|
|
pub use codex_model_provider_info::RemoteCompactionSupport;
|
|
pub use codex_protocol::account::ProviderAccount;
|
|
pub use provider::ModelProvider;
|
|
pub use provider::ModelProviderFuture;
|
|
pub use provider::ProviderAccountError;
|
|
pub use provider::ProviderAccountResult;
|
|
pub use provider::ProviderAccountState;
|
|
pub use provider::ProviderAuthRecoveryMessages;
|
|
pub use provider::ProviderUnauthorizedRecovery;
|
|
pub use provider::SharedModelProvider;
|
|
pub use provider::create_model_provider;
|
|
pub use provider::provider_uses_first_party_auth_path;
|
|
pub use provider::resolve_api_provider;
|
|
|
|
pub use request_preparation::prepare_provider_request;
|
|
pub use runtime_auth::select_runtime_auth;
|
|
pub use runtime_auth::validate_runtime_destination;
|
|
pub use runtime_auth::validate_runtime_provider;
|
|
pub use runtime_auth::validate_runtime_selectors;
|
|
|
|
#[cfg(test)]
|
|
#[path = "workspace_routing_tests.rs"]
|
|
mod workspace_routing_tests;
|