From 756b3174e450fa1b5e513fe6fba4e036f537cd0d Mon Sep 17 00:00:00 2001 From: rreichel3-oai Date: Mon, 4 May 2026 11:26:40 -0400 Subject: [PATCH] Restore forced workspace config shape codex-rs/config/src/config_toml.rs: restore the backward-compatible ForcedChatgptWorkspaceIds enum that the rebased branch still references when parsing forced_chatgpt_workspace_id. --- codex-rs/config/src/config_toml.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/codex-rs/config/src/config_toml.rs b/codex-rs/config/src/config_toml.rs index 401d9fdf61..8035dcfa9b 100644 --- a/codex-rs/config/src/config_toml.rs +++ b/codex-rs/config/src/config_toml.rs @@ -86,6 +86,23 @@ const fn default_hide_agent_reasoning() -> Option { Some(false) } +/// Backward-compatible shape for workspace restrictions in config.toml. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema)] +#[serde(untagged)] +pub enum ForcedChatgptWorkspaceIds { + Single(String), + Multiple(Vec), +} + +impl ForcedChatgptWorkspaceIds { + pub fn into_vec(self) -> Vec { + match self { + Self::Single(value) => vec![value], + Self::Multiple(values) => values, + } + } +} + /// Base config deserialized from ~/.codex/config.toml. #[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, JsonSchema)] #[schemars(deny_unknown_fields)]