mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
31372078d1
## Why Authentication mode is a domain concept used by login, model selection, telemetry, and transports. Keeping the canonical type in app-server protocol forces those lower-level crates to depend on an unrelated wire API. ## What changed - Added canonical `codex_protocol::auth::AuthMode` domain values. - Kept the app-server wire DTO unchanged and added an explicit app-side conversion. - Removed production app-server-protocol dependencies from login, model-provider-info, models-manager, and otel call paths. ## Stack This is PR 2 of 6, stacked on [PR #29714](https://github.com/openai/codex/pull/29714). Review only the delta from `codex/split-json-rpc-protocols`. Next: [PR #29722](https://github.com/openai/codex/pull/29722). ## Validation - Auth and login coverage passed in the focused protocol/domain test run. - App-server account and auth conversion coverage passed.
27 lines
805 B
Rust
27 lines
805 B
Rust
pub(crate) mod cache;
|
|
pub mod collaboration_mode_presets;
|
|
pub(crate) mod config;
|
|
pub mod manager;
|
|
pub mod model_info;
|
|
pub mod model_presets;
|
|
pub mod test_support;
|
|
|
|
pub use codex_protocol::auth::AuthMode;
|
|
pub use config::ModelsManagerConfig;
|
|
|
|
/// Load the bundled model catalog shipped with `codex-models-manager`.
|
|
pub fn bundled_models_response()
|
|
-> std::result::Result<codex_protocol::openai_models::ModelsResponse, serde_json::Error> {
|
|
serde_json::from_str(include_str!("../models.json"))
|
|
}
|
|
|
|
/// Convert the client version string to a whole version string (e.g. "1.2.3-alpha.4" -> "1.2.3").
|
|
pub fn client_version_to_whole() -> String {
|
|
format!(
|
|
"{}.{}.{}",
|
|
env!("CARGO_PKG_VERSION_MAJOR"),
|
|
env!("CARGO_PKG_VERSION_MINOR"),
|
|
env!("CARGO_PKG_VERSION_PATCH")
|
|
)
|
|
}
|