From 555a172722e79c0c07babdba6ba927ac11bdff13 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Mon, 14 Jul 2025 23:50:37 -0700 Subject: [PATCH] fixing bugs --- codex-rs/core/src/config_types.rs | 66 ++++--------------------------- 1 file changed, 7 insertions(+), 59 deletions(-) diff --git a/codex-rs/core/src/config_types.rs b/codex-rs/core/src/config_types.rs index aac792162b..d78bd10eae 100644 --- a/codex-rs/core/src/config_types.rs +++ b/codex-rs/core/src/config_types.rs @@ -150,7 +150,7 @@ pub type EnvironmentVariablePattern = WildMatchPattern<'*', '?'>; /// Deriving the `env` based on this policy works as follows: /// 1. Create an initial map based on the `inherit` policy. /// 2. If `ignore_default_excludes` is false, filter the map using the default -/// exclude pattern(s), which are: `"*KEY*"` and `"*TOKEN*"`. +/// exclude pattern(s), which are: "*KEY*" and "*TOKEN*". /// 3. If `exclude` is not empty, filter the map using the provided patterns. /// 4. Insert any entries from `r#set` into the map. /// 5. If non-empty, filter the map using the `include_only` patterns. @@ -229,61 +229,9 @@ pub enum ReasoningSummary { None, } -/// Base config deserialized from ~/.codex/config.toml. -#[derive(Deserialize, Debug, Clone, Default)] -pub struct ConfigToml { - /// Optional override of model selection. - pub model: Option, - /// Provider to use from the model_providers map. - pub model_provider: Option, - /// Size of the context window for the model, in tokens. - pub model_context_window: Option, - /// Maximum number of output tokens. - pub model_max_output_tokens: Option, - /// Default approval policy for executing commands. - pub approval_policy: Option, - #[serde(default)] - pub shell_environment_policy: crate::config_types::ShellEnvironmentPolicyToml, - /// Sandbox mode to use. - pub sandbox_mode: Option, - /// Sandbox configuration to apply if `sandbox` is `WorkspaceWrite`. - pub sandbox_workspace_write: Option, - /// Disable server-side response storage. - pub disable_response_storage: Option, - /// Optional external command to spawn for end-user notifications. - #[serde(default)] - pub notify: Option>, - /// System instructions. - pub instructions: Option, - /// Definition for MCP servers that Codex can reach out to for tool calls. - #[serde(default)] - pub mcp_servers: HashMap, - /// User-defined provider entries that extend/override the built-in list. - #[serde(default)] - pub model_providers: HashMap, - /// Maximum number of bytes to include from an AGENTS.md project doc file. - pub project_doc_max_bytes: Option, - /// Profile to use from the `profiles` map. - pub profile: Option, - /// Named profiles to facilitate switching between different configurations. - #[serde(default)] - pub profiles: HashMap, - /// Settings that govern if and what will be written to `~/.codex/history.jsonl`. - #[serde(default)] - pub history: Option, - /// Optional URI-based file opener. - pub file_opener: Option, - /// Collection of settings that are specific to the TUI. - pub tui: Option, - /// When set to `true`, `AgentReasoning` events will be hidden from the UI/output. - pub hide_agent_reasoning: Option, - pub model_reasoning_effort: Option, - pub model_reasoning_summary: Option, - /// Override to force-enable reasoning summaries for the configured model. - pub model_supports_reasoning_summaries: Option, - /// Base URL for requests to ChatGPT (as opposed to the OpenAI API). - pub chatgpt_base_url: Option, - /// Global toggle to enable/disable streaming (delta) output. - #[serde(default)] - pub streaming: Option, -} +// --------------------------------------------------------------------------- +// NOTE: The canonical ConfigToml definition lives in `crate::config`. +// Historically this file accidentally re-declared that struct, which caused +// drift and confusion. The duplicate has been removed; please use +// `codex_core::config::ConfigToml` instead. +// ---------------------------------------------------------------------------