mirror of
https://github.com/openai/codex.git
synced 2026-05-16 01:02:48 +00:00
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.
This commit is contained in:
@@ -86,6 +86,23 @@ const fn default_hide_agent_reasoning() -> Option<bool> {
|
||||
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<String>),
|
||||
}
|
||||
|
||||
impl ForcedChatgptWorkspaceIds {
|
||||
pub fn into_vec(self) -> Vec<String> {
|
||||
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)]
|
||||
|
||||
Reference in New Issue
Block a user