diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index dcc6a72da9..c6564bd8d5 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -6739,13 +6739,37 @@ ] }, "AuthCredentialsStoreMode": { - "enum": [ - "file", - "keyring", - "auto", - "ephemeral" - ], - "type": "string" + "description": "Determines where Codex stores CLI authentication credentials.", + "oneOf": [ + { + "description": "Persist credentials in `CODEX_HOME/auth.json`.", + "enum": [ + "file" + ], + "type": "string" + }, + { + "description": "Persist credentials in the operating system keyring. Fail if unavailable.", + "enum": [ + "keyring" + ], + "type": "string" + }, + { + "description": "Use the operating system keyring when available; otherwise, fall back to `CODEX_HOME/auth.json`.", + "enum": [ + "auto" + ], + "type": "string" + }, + { + "description": "Store credentials in memory only for the current process.", + "enum": [ + "ephemeral" + ], + "type": "string" + } + ] }, "AuthMode": { "description": "Authentication mode for OpenAI-backed providers.", @@ -7644,6 +7668,16 @@ ], "description": "[UNSTABLE] Optional default for where approval requests are routed for review." }, + "cli_auth_credentials_store": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AuthCredentialsStoreMode" + }, + { + "type": "null" + } + ] + }, "compact_prompt": { "type": [ "string", diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 81ff038216..da5477434b 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -1008,13 +1008,37 @@ ] }, "AuthCredentialsStoreMode": { - "enum": [ - "file", - "keyring", - "auto", - "ephemeral" - ], - "type": "string" + "description": "Determines where Codex stores CLI authentication credentials.", + "oneOf": [ + { + "description": "Persist credentials in `CODEX_HOME/auth.json`.", + "enum": [ + "file" + ], + "type": "string" + }, + { + "description": "Persist credentials in the operating system keyring. Fail if unavailable.", + "enum": [ + "keyring" + ], + "type": "string" + }, + { + "description": "Use the operating system keyring when available; otherwise, fall back to `CODEX_HOME/auth.json`.", + "enum": [ + "auto" + ], + "type": "string" + }, + { + "description": "Store credentials in memory only for the current process.", + "enum": [ + "ephemeral" + ], + "type": "string" + } + ] }, "AuthMode": { "description": "Authentication mode for OpenAI-backed providers.", @@ -3957,6 +3981,16 @@ ], "description": "[UNSTABLE] Optional default for where approval requests are routed for review." }, + "cli_auth_credentials_store": { + "anyOf": [ + { + "$ref": "#/definitions/AuthCredentialsStoreMode" + }, + { + "type": "null" + } + ] + }, "compact_prompt": { "type": [ "string", diff --git a/codex-rs/app-server-protocol/schema/json/v2/ConfigReadResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ConfigReadResponse.json index 3bc0a8e0a9..ed8bde40a3 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ConfigReadResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ConfigReadResponse.json @@ -208,6 +208,39 @@ } ] }, + "AuthCredentialsStoreMode": { + "description": "Determines where Codex stores CLI authentication credentials.", + "oneOf": [ + { + "description": "Persist credentials in `CODEX_HOME/auth.json`.", + "enum": [ + "file" + ], + "type": "string" + }, + { + "description": "Persist credentials in the operating system keyring. Fail if unavailable.", + "enum": [ + "keyring" + ], + "type": "string" + }, + { + "description": "Use the operating system keyring when available; otherwise, fall back to `CODEX_HOME/auth.json`.", + "enum": [ + "auto" + ], + "type": "string" + }, + { + "description": "Store credentials in memory only for the current process.", + "enum": [ + "ephemeral" + ], + "type": "string" + } + ] + }, "AutoCompactTokenLimitScope": { "description": "Selects which part of the active context is charged against `model_auto_compact_token_limit`.", "oneOf": [ @@ -261,6 +294,16 @@ ], "description": "[UNSTABLE] Optional default for where approval requests are routed for review." }, + "cli_auth_credentials_store": { + "anyOf": [ + { + "$ref": "#/definitions/AuthCredentialsStoreMode" + }, + { + "type": "null" + } + ] + }, "compact_prompt": { "type": [ "string", diff --git a/codex-rs/app-server-protocol/schema/json/v2/ConfigRequirementsReadResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ConfigRequirementsReadResponse.json index 8adbc08978..bacb0dfe1e 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ConfigRequirementsReadResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ConfigRequirementsReadResponse.json @@ -65,13 +65,37 @@ ] }, "AuthCredentialsStoreMode": { - "enum": [ - "file", - "keyring", - "auto", - "ephemeral" - ], - "type": "string" + "description": "Determines where Codex stores CLI authentication credentials.", + "oneOf": [ + { + "description": "Persist credentials in `CODEX_HOME/auth.json`.", + "enum": [ + "file" + ], + "type": "string" + }, + { + "description": "Persist credentials in the operating system keyring. Fail if unavailable.", + "enum": [ + "keyring" + ], + "type": "string" + }, + { + "description": "Use the operating system keyring when available; otherwise, fall back to `CODEX_HOME/auth.json`.", + "enum": [ + "auto" + ], + "type": "string" + }, + { + "description": "Store credentials in memory only for the current process.", + "enum": [ + "ephemeral" + ], + "type": "string" + } + ] }, "ComputerUseRequirements": { "properties": { diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/AuthCredentialsStoreMode.ts b/codex-rs/app-server-protocol/schema/typescript/v2/AuthCredentialsStoreMode.ts index e8714cc4b9..ecc556b9da 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/AuthCredentialsStoreMode.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/AuthCredentialsStoreMode.ts @@ -2,4 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * Determines where Codex stores CLI authentication credentials. + */ export type AuthCredentialsStoreMode = "file" | "keyring" | "auto" | "ephemeral"; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/Config.ts b/codex-rs/app-server-protocol/schema/typescript/v2/Config.ts index cc15fb4e72..aa1ffc41a4 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/Config.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/Config.ts @@ -11,6 +11,7 @@ import type { JsonValue } from "../serde_json/JsonValue"; import type { AnalyticsConfig } from "./AnalyticsConfig"; import type { ApprovalsReviewer } from "./ApprovalsReviewer"; import type { AskForApproval } from "./AskForApproval"; +import type { AuthCredentialsStoreMode } from "./AuthCredentialsStoreMode"; import type { ForcedChatgptWorkspaceIds } from "./ForcedChatgptWorkspaceIds"; import type { SandboxMode } from "./SandboxMode"; import type { SandboxWorkspaceWrite } from "./SandboxWorkspaceWrite"; @@ -20,4 +21,4 @@ export type Config = {model: string | null, review_model: string | null, model_c * [UNSTABLE] Optional default for where approval requests are routed for * review. */ -approvals_reviewer: ApprovalsReviewer | null, sandbox_mode: SandboxMode | null, sandbox_workspace_write: SandboxWorkspaceWrite | null, forced_chatgpt_workspace_id: ForcedChatgptWorkspaceIds | null, forced_login_method: ForcedLoginMethod | null, web_search: WebSearchMode | null, tools: ToolsV2 | null, instructions: string | null, developer_instructions: string | null, compact_prompt: string | null, model_reasoning_effort: ReasoningEffort | null, model_reasoning_summary: ReasoningSummary | null, model_verbosity: Verbosity | null, service_tier: string | null, analytics: AnalyticsConfig | null, desktop: { [key in string]?: JsonValue } | null} & ({ [key in string]?: number | string | boolean | Array | { [key in string]?: JsonValue } | null }); +approvals_reviewer: ApprovalsReviewer | null, sandbox_mode: SandboxMode | null, sandbox_workspace_write: SandboxWorkspaceWrite | null, forced_chatgpt_workspace_id: ForcedChatgptWorkspaceIds | null, forced_login_method: ForcedLoginMethod | null, cli_auth_credentials_store: AuthCredentialsStoreMode | null, web_search: WebSearchMode | null, tools: ToolsV2 | null, instructions: string | null, developer_instructions: string | null, compact_prompt: string | null, model_reasoning_effort: ReasoningEffort | null, model_reasoning_summary: ReasoningSummary | null, model_verbosity: Verbosity | null, service_tier: string | null, analytics: AnalyticsConfig | null, desktop: { [key in string]?: JsonValue } | null} & ({ [key in string]?: number | string | boolean | Array | { [key in string]?: JsonValue } | null }); diff --git a/codex-rs/app-server-protocol/src/protocol/v2/config.rs b/codex-rs/app-server-protocol/src/protocol/v2/config.rs index 207e8d6d2b..1d5805eaae 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2/config.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2/config.rs @@ -4,6 +4,7 @@ use super::SandboxMode; use super::WindowsSandboxSetupMode; use super::shared::default_enabled; use codex_experimental_api_macros::ExperimentalApi; +pub use codex_protocol::config_types::AuthCredentialsStoreMode; use codex_protocol::config_types::AutoCompactTokenLimitScope; use codex_protocol::config_types::ForcedLoginMethod; use codex_protocol::config_types::ReasoningSummary; @@ -257,6 +258,7 @@ pub struct Config { pub sandbox_workspace_write: Option, pub forced_chatgpt_workspace_id: Option, pub forced_login_method: Option, + pub cli_auth_credentials_store: Option, pub web_search: Option, pub tools: Option, pub instructions: Option, @@ -408,16 +410,6 @@ pub struct ConfigRequirements { pub windows_sandbox_private_desktop: Option, } -#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] -#[serde(rename_all = "lowercase")] -#[ts(export_to = "v2/")] -pub enum AuthCredentialsStoreMode { - File, - Keyring, - Auto, - Ephemeral, -} - #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] #[serde(rename_all = "camelCase")] #[ts(export_to = "v2/")] diff --git a/codex-rs/app-server-protocol/src/protocol/v2/tests.rs b/codex-rs/app-server-protocol/src/protocol/v2/tests.rs index 30a97ca2c2..1ea89c32e4 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2/tests.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2/tests.rs @@ -1634,6 +1634,7 @@ fn config_granular_approval_policy_is_marked_experimental() { sandbox_workspace_write: None, forced_chatgpt_workspace_id: None, forced_login_method: None, + cli_auth_credentials_store: None, web_search: None, tools: None, instructions: None, @@ -1667,6 +1668,7 @@ fn config_approvals_reviewer_is_marked_experimental() { sandbox_workspace_write: None, forced_chatgpt_workspace_id: None, forced_login_method: None, + cli_auth_credentials_store: None, web_search: None, tools: None, instructions: None, diff --git a/codex-rs/app-server/src/request_processors/config_processor.rs b/codex-rs/app-server/src/request_processors/config_processor.rs index 65b4697d54..d629204895 100644 --- a/codex-rs/app-server/src/request_processors/config_processor.rs +++ b/codex-rs/app-server/src/request_processors/config_processor.rs @@ -7,7 +7,6 @@ use crate::error_code::invalid_request; use crate::outgoing_message::ConnectionRequestId; use crate::outgoing_message::OutgoingMessageSender; use codex_analytics::AnalyticsEventsClient; -use codex_app_server_protocol::AuthCredentialsStoreMode as ApiAuthCredentialsStoreMode; use codex_app_server_protocol::ClientResponsePayload; use codex_app_server_protocol::ComputerUseRequirements; use codex_app_server_protocol::ConfigBatchWriteParams; @@ -38,7 +37,6 @@ use codex_config::ManagedHooksRequirementsToml; use codex_config::MatcherGroup as CoreMatcherGroup; use codex_config::ResidencyRequirement as CoreResidencyRequirement; use codex_config::SandboxModeRequirement as CoreSandboxModeRequirement; -use codex_config::types::AuthCredentialsStoreMode as CoreAuthCredentialsStoreMode; use codex_core::ThreadManager; use codex_features::canonical_feature_for_key; use codex_features::feature_for_key; @@ -386,14 +384,7 @@ fn map_requirements_toml_to_api(requirements: ConfigRequirementsToml) -> ConfigR network: requirements.network.map(map_network_requirements_to_api), allowed_login_methods: requirements.allowed_login_methods, allowed_chatgpt_workspaces: requirements.allowed_chatgpt_workspaces, - cli_auth_credentials_store: requirements.cli_auth_credentials_store.map( - |mode| match mode { - CoreAuthCredentialsStoreMode::File => ApiAuthCredentialsStoreMode::File, - CoreAuthCredentialsStoreMode::Keyring => ApiAuthCredentialsStoreMode::Keyring, - CoreAuthCredentialsStoreMode::Auto => ApiAuthCredentialsStoreMode::Auto, - CoreAuthCredentialsStoreMode::Ephemeral => ApiAuthCredentialsStoreMode::Ephemeral, - }, - ), + cli_auth_credentials_store: requirements.cli_auth_credentials_store, chatgpt_base_url: requirements.chatgpt_base_url, sqlite_home: requirements.sqlite_home, log_dir: requirements.log_dir, diff --git a/codex-rs/app-server/tests/suite/v2/config_rpc.rs b/codex-rs/app-server/tests/suite/v2/config_rpc.rs index bfb7d81720..427995f9fd 100644 --- a/codex-rs/app-server/tests/suite/v2/config_rpc.rs +++ b/codex-rs/app-server/tests/suite/v2/config_rpc.rs @@ -9,6 +9,7 @@ use codex_app_server_protocol::ApprovalsReviewer; use codex_app_server_protocol::AppsConfig; use codex_app_server_protocol::AppsDefaultConfig; use codex_app_server_protocol::AskForApproval; +use codex_app_server_protocol::AuthCredentialsStoreMode; use codex_app_server_protocol::ConfigBatchWriteParams; use codex_app_server_protocol::ConfigEdit; use codex_app_server_protocol::ConfigLayerSource; @@ -83,6 +84,7 @@ async fn config_read_returns_effective_and_layers() -> Result<()> { r#" model = "gpt-user" sandbox_mode = "workspace-write" +cli_auth_credentials_store = "keyring" "#, )?; let codex_home_path = codex_home.path().canonicalize()?; @@ -109,6 +111,10 @@ sandbox_mode = "workspace-write" } = to_response(resp)?; assert_eq!(config.model.as_deref(), Some("gpt-user")); + assert_eq!( + config.cli_auth_credentials_store, + Some(AuthCredentialsStoreMode::Keyring) + ); assert_eq!( origins.get("model").expect("origin").name, ConfigLayerSource::User { diff --git a/codex-rs/config/src/requirements_layers/otel.rs b/codex-rs/config/src/requirements_layers/otel.rs index 12281aabe8..1f0552c5c1 100644 --- a/codex-rs/config/src/requirements_layers/otel.rs +++ b/codex-rs/config/src/requirements_layers/otel.rs @@ -5,9 +5,11 @@ use std::collections::BTreeMap; /// Merges one OTEL requirements layer into an output assembled high-to-low. /// -/// Exporters and scalar settings are exact leaves, while trace metadata is -/// recursively merged by key. Keeping this policy typed prevents exporter -/// variants, credentials, and TLS settings from being combined field by field. +/// `log_user_prompt` and `environment` use the first value supplied by a +/// higher-priority layer. Each exporter is also selected as a complete value: +/// for example, the endpoint from one layer is never combined with the headers +/// or TLS settings from another. Span attributes and tracestate are merged by +/// key instead. pub(super) fn merge( output: &mut Option>, incoming: Option, diff --git a/codex-rs/config/src/types.rs b/codex-rs/config/src/types.rs index 044d09ca85..0038621049 100644 --- a/codex-rs/config/src/types.rs +++ b/codex-rs/config/src/types.rs @@ -13,6 +13,7 @@ pub use crate::mcp_types::McpServerTransportConfig; pub use crate::mcp_types::RawMcpServerConfig; pub use codex_protocol::config_types::AltScreenMode; pub use codex_protocol::config_types::ApprovalsReviewer; +pub use codex_protocol::config_types::AuthCredentialsStoreMode; use codex_protocol::config_types::EnvironmentVariablePattern; pub use codex_protocol::config_types::ModeKind; pub use codex_protocol::config_types::Personality; @@ -83,21 +84,6 @@ impl fmt::Display for SessionPickerViewMode { } } -/// Determine where Codex should store CLI auth credentials. -#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] -#[serde(rename_all = "lowercase")] -pub enum AuthCredentialsStoreMode { - #[default] - /// Persist credentials in CODEX_HOME/auth.json. - File, - /// Persist credentials in the keyring. Fail if unavailable. - Keyring, - /// Use keyring when available; otherwise, fall back to a file in CODEX_HOME. - Auto, - /// Store credentials in memory only for the current process. - Ephemeral, -} - /// Determine where Codex should store and read MCP credentials. #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "lowercase")] diff --git a/codex-rs/core/config.schema.json b/codex-rs/core/config.schema.json index 31daf2feb4..1ab89e7197 100644 --- a/codex-rs/core/config.schema.json +++ b/codex-rs/core/config.schema.json @@ -281,24 +281,24 @@ ] }, "AuthCredentialsStoreMode": { - "description": "Determine where Codex should store CLI auth credentials.", + "description": "Determines where Codex stores CLI authentication credentials.", "oneOf": [ { - "description": "Persist credentials in CODEX_HOME/auth.json.", + "description": "Persist credentials in `CODEX_HOME/auth.json`.", "enum": [ "file" ], "type": "string" }, { - "description": "Persist credentials in the keyring. Fail if unavailable.", + "description": "Persist credentials in the operating system keyring. Fail if unavailable.", "enum": [ "keyring" ], "type": "string" }, { - "description": "Use keyring when available; otherwise, fall back to a file in CODEX_HOME.", + "description": "Use the operating system keyring when available; otherwise, fall back to `CODEX_HOME/auth.json`.", "enum": [ "auto" ], @@ -5274,4 +5274,4 @@ }, "title": "ConfigToml", "type": "object" -} +} \ No newline at end of file diff --git a/codex-rs/core/src/config/config_tests.rs b/codex-rs/core/src/config/config_tests.rs index f5747bce34..ce1dd5a328 100644 --- a/codex-rs/core/src/config/config_tests.rs +++ b/codex-rs/core/src/config/config_tests.rs @@ -9453,7 +9453,7 @@ sandbox_private_desktop = false ]) ); assert!(config.startup_warnings.iter().any(|warning| { - warning.contains("Configured leaves under `shell_environment_policy` are overridden") + warning.contains("Configured values under `shell_environment_policy` are overridden") })); Ok(()) } diff --git a/codex-rs/core/src/config/otel.rs b/codex-rs/core/src/config/otel.rs index c81f02c69e..2e8ec3b3bf 100644 --- a/codex-rs/core/src/config/otel.rs +++ b/codex-rs/core/src/config/otel.rs @@ -38,6 +38,12 @@ pub(crate) fn resolve_config( } } +/// Applies required OTEL settings to user-configured OTEL settings. +/// +/// Required settings and complete exporters replace their configured values, +/// while span attributes and tracestate are merged by key. Invalid required +/// trace metadata returns an error; configured conflicts produce startup +/// warnings. pub(super) fn apply_requirement( configured: &mut Option, requirement: &Sourced, @@ -103,7 +109,12 @@ pub(super) fn apply_requirement( )); } - super::requirements::push_leaf_override_warning("otel", conflict, source, startup_warnings); + super::requirements::push_structured_requirement_override_warning( + "otel", + conflict, + source, + startup_warnings, + ); Ok(()) } diff --git a/codex-rs/core/src/config/requirements.rs b/codex-rs/core/src/config/requirements.rs index 42692dbcc8..76e2f2d5d5 100644 --- a/codex-rs/core/src/config/requirements.rs +++ b/codex-rs/core/src/config/requirements.rs @@ -9,12 +9,23 @@ use codex_protocol::config_types::ForcedLoginMethod; use super::otel; +/// Runtime values that cannot be applied by mutating [`ConfigToml`] alone. +/// +/// Other managed settings are written back into `ConfigToml`. These values need +/// additional credential-store compatibility handling or intersection with the +/// configured authentication restrictions before constructing the final config. pub(super) struct AppliedConfigRequirements { pub cli_auth_credentials_store_mode: AuthCredentialsStoreMode, pub forced_login_method: Option, pub forced_chatgpt_workspace_id: Option>, } +/// Applies managed requirements to regular config before final config construction. +/// +/// Managed values replace or merge with their configured counterparts, and +/// conflicts produce source-aware startup warnings. Effective authentication +/// values that need additional resolution are returned separately. Invalid or +/// conflicting requirements return an error. pub(super) fn apply_to_config( config: &mut ConfigToml, requirements: &ConfigRequirements, @@ -163,7 +174,7 @@ fn apply_shell_environment_policy_requirement( configured_set.extend(required.clone()); } - push_leaf_override_warning( + push_structured_requirement_override_warning( "shell_environment_policy", conflict, source, @@ -182,10 +193,12 @@ fn apply_feedback_requirement( let FeedbackConfigToml { enabled } = value; let configured = configured.get_or_insert_default(); let conflict = replace_required_leaf(&mut configured.enabled, enabled); - push_leaf_override_warning("feedback", conflict, source, startup_warnings); + push_structured_requirement_override_warning("feedback", conflict, source, startup_warnings); } -pub(super) fn push_leaf_override_warning( +/// Emits one source-aware warning when a structured requirement replaces one +/// or more configured values. +pub(super) fn push_structured_requirement_override_warning( field_name: &str, conflict: bool, source: &RequirementSource, @@ -196,10 +209,10 @@ pub(super) fn push_leaf_override_warning( } tracing::warn!( ?source, - "configured value contains leaves overridden by exact requirements for {field_name}" + "configured values are overridden by requirements for {field_name}" ); startup_warnings.push(format!( - "Configured leaves under `{field_name}` are overridden by requirements from {source}." + "Configured values under `{field_name}` are overridden by requirements from {source}." )); } diff --git a/codex-rs/protocol/src/config_types.rs b/codex-rs/protocol/src/config_types.rs index 713945dbde..acc1205dc7 100644 --- a/codex-rs/protocol/src/config_types.rs +++ b/codex-rs/protocol/src/config_types.rs @@ -21,6 +21,23 @@ use wildmatch::WildMatchPattern; use crate::openai_models::ReasoningEffort; +/// Determines where Codex stores CLI authentication credentials. +#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema, TS)] +#[serde(rename_all = "lowercase")] +#[ts(export_to = "v2/")] +pub enum AuthCredentialsStoreMode { + /// Persist credentials in `CODEX_HOME/auth.json`. + #[default] + File, + /// Persist credentials in the operating system keyring. Fail if unavailable. + Keyring, + /// Use the operating system keyring when available; otherwise, fall back to + /// `CODEX_HOME/auth.json`. + Auto, + /// Store credentials in memory only for the current process. + Ephemeral, +} + /// Selects which part of the active context is charged against /// `model_auto_compact_token_limit`. #[derive(