From cfe4234d1620a99f82b427497bfc43a688c0c0b6 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Thu, 23 Apr 2026 12:29:47 +0200 Subject: [PATCH] feat: error on config --- codex-rs/core/src/config/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/codex-rs/core/src/config/mod.rs b/codex-rs/core/src/config/mod.rs index 5f77a6c5e6f5..d30ed79a6ec0 100644 --- a/codex-rs/core/src/config/mod.rs +++ b/codex-rs/core/src/config/mod.rs @@ -1948,6 +1948,13 @@ impl Config { let history = cfg.history.unwrap_or_default(); + let agent_max_threads_from_config = cfg.agents.as_ref().and_then(|agents| agents.max_threads); + if features.enabled(Feature::MultiAgentV2) && agent_max_threads_from_config.is_some() { + return Err(std::io::Error::new( + std::io::ErrorKind::InvalidInput, + "agents.max_threads cannot be set when multi_agent_v2 is enabled", + )); + } let agent_max_threads = cfg .agents .as_ref()