{"record":{"id":"b689431bec717159","repo":"openai/codex","slug":"features-multi-agent-v2-max-concurrent-threads-per","errorCode":null,"errorMessage":"features.multi_agent_v2.max_concurrent_threads_per_session must be at least 1","messagePattern":"features\\.multi_agent_v2\\.max_concurrent_threads_per_session must be at least 1","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/config/mod.rs","lineNumber":3710,"sourceCode":"        let model_provider = model_providers\n            .get(&model_provider_id)\n            .ok_or_else(|| {\n                let message = if model_provider_id == LEGACY_OLLAMA_CHAT_PROVIDER_ID {\n                    OLLAMA_CHAT_PROVIDER_REMOVED_ERROR.to_string()\n                } else {\n                    format!(\"Model provider `{model_provider_id}` not found\")\n                };\n                std::io::Error::new(std::io::ErrorKind::NotFound, message)\n            })?\n            .clone();\n\n        let shell_environment_policy = cfg.shell_environment_policy.into();\n        let allow_login_shell = cfg.allow_login_shell.unwrap_or(true);\n\n        let history = cfg.history.unwrap_or_default();\n\n        if multi_agent_v2.max_concurrent_threads_per_session == 0 {\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                \"features.multi_agent_v2.max_concurrent_threads_per_session must be at least 1\",\n            ));\n        }\n        validate_multi_agent_v2_wait_timeout(\n            \"features.multi_agent_v2.min_wait_timeout_ms\",\n            multi_agent_v2.min_wait_timeout_ms,\n        )?;\n        validate_multi_agent_v2_wait_timeout(\n            \"features.multi_agent_v2.max_wait_timeout_ms\",\n            multi_agent_v2.max_wait_timeout_ms,\n        )?;\n        validate_multi_agent_v2_wait_timeout(\n            \"features.multi_agent_v2.default_wait_timeout_ms\",\n            multi_agent_v2.default_wait_timeout_ms,\n        )?;\n        if multi_agent_v2.min_wait_timeout_ms > multi_agent_v2.max_wait_timeout_ms {\n            return Err(std::io::Error::new(","sourceCodeStart":3692,"sourceCodeEnd":3728,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/config/mod.rs#L3692-L3728","documentation":"resolve_multi_agent_v2_config reads `[features.multi_agent_v2]`, and Config::load enforces max_concurrent_threads_per_session >= 1 because a session must allow at least one concurrent subagent thread. Defaults are non-zero, so hitting this means the key was explicitly set to 0 in some layer.","triggerScenarios":"`[features.multi_agent_v2]` with `max_concurrent_threads_per_session = 0` in ~/.codex/config.toml, a project layer, or a managed layer. Fires during Config::load after model-provider resolution.","commonSituations":"Trying to disable multi-agent v2 by zeroing the limit instead of using the feature's enable switch; copy-paste from tuned examples; a managed layer zeroing the knob globally.","solutions":["Set `max_concurrent_threads_per_session = 1` (serial subagent execution) or higher.","Or delete the key to fall back to the built-in default.","If the goal is to turn the feature off, disable the multi_agent_v2 feature rather than zeroing the limit."],"exampleFix":"# before\n[features.multi_agent_v2]\nmax_concurrent_threads_per_session = 0\n\n# after\n[features.multi_agent_v2]\nmax_concurrent_threads_per_session = 1","handlingStrategy":"validation","validationCode":"import tomllib\ncfg = tomllib.load(open(\"config.toml\", \"rb\"))\nma = cfg.get(\"features\", {}).get(\"multi_agent_v2\", {})\nlimit = ma.get(\"max_concurrent_threads_per_session\")\nassert limit is None or limit >= 1, \"max_concurrent_threads_per_session must be >= 1\"","typeGuard":null,"tryCatchPattern":"match config_result {\n    Err(ref e) if e.kind() == std::io::ErrorKind::InvalidInput\n        && e.to_string().contains(\"features.multi_agent_v2.max_concurrent_threads_per_session\") => {\n        // clamp to 1 or drop the key, then retry\n    }\n    other => other,\n}","preventionTips":["Treat 0 as invalid for concurrency limits; use feature switches to disable","Validate numeric feature knobs when generating configs","Remember the same rule applies to the [agents] twin of this setting"],"tags":["codex","config","multi-agent","validation"],"backgroundTag":"config-value-out-of-range","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}