Repository navigation
Codex Desktop: MultiAgentV2 silently bypasses agents.max_threads with no migration warning #33447
Description
What variant of Codex are you using?
- Codex Desktop
26.707.9981.0 - Bundled Codex CLI
0.144.2 - Windows x86_64
- Model:
gpt-5.6-sol
What happened?
Codex Desktop started a new task with a model-visible limit of four concurrent agent threads even though the user configuration set a higher agents.max_threads value:
[agents]
max_threads = 10
max_depth = 2The task reported:
There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you.
Changing agents.max_threads from 10 to 111, fully restarting Codex Desktop, and creating another task still produced the same four-slot limit.
Desktop showed no warning or migration guidance explaining that:
- the active Desktop task was using the MultiAgentV2 collaboration surface;
agents.max_threadsdoes not control MultiAgentV2 concurrency;- MultiAgentV2 uses
features.multi_agent_v2.max_concurrent_threads_per_session; - the default total is four threads, including the root;
- or which configuration/runtime layer supplied the effective value.
Before adding an explicit v2 configuration, codex features list reported multi_agent_v2 as disabled, while the Desktop task exposed the v2-style collaboration.spawn_agent schema and enforced the four-slot session limit. This made the effective feature and configuration source especially difficult to discover.
Steps to reproduce
-
Add this to
~/.codex/config.toml:[agents] max_threads = 10 max_depth = 2
-
Fully restart Codex Desktop.
-
Create a new Desktop task that can use subagents.
-
Ask the root agent how many concurrency slots are available, or inspect the model-visible session instructions.
-
Observe a total of four slots (root + three children), rather than the configured
agents.max_threadsvalue. -
Increase
agents.max_threads, restart Desktop, and create another task. -
Observe that the effective limit remains four and no actionable migration warning is shown.
Expected behavior
If Codex Desktop enables MultiAgentV2 for a task while the user has configured agents.max_threads, it should do at least one of the following:
- migrate the value to the v2 setting;
- show an actionable startup warning naming the replacement key;
- reject the conflicting configuration with a clear error before the task starts; or
- expose the effective concurrency limit and its source in Desktop diagnostics/settings.
The public documentation should also distinguish among:
- Codex v1
agents.max_threads; - Desktop/CLI MultiAgentV2
max_concurrent_threads_per_session; and - Responses API
max_concurrent_subagents.
Actual behavior
Desktop silently started with the default four-slot limit. The user-visible configuration contained a higher agents.max_threads value, but there was no indication that another feature/configuration path had superseded it.
Confirmed local workaround
After removing agents.max_threads and using:
[agents]
max_depth = 2
[features.multi_agent_v2]
enabled = true
max_concurrent_threads_per_session = 111the local Codex configuration loader accepted the configuration:
-
codex features listreportedmulti_agent_v2 ... true; -
codex doctor --summaryreportedconfig loaded; and -
codex debug prompt-input probeproduced:There are 111 available concurrency slots, meaning that up to 111 agents can be active at once, including you.
This confirms the replacement setting is recognized locally. It does not solve the discoverability or migration problem, and the Desktop runtime still requires a restart/new-task verification.
Current source behavior
The current openai/codex source and generated schema expose the mismatch:
-
MultiAgentV2ConfigTomldefinesmax_concurrent_threads_per_session; -
the v2 default is four total session threads;
-
the child-thread budget is derived by subtracting the root thread; and
-
config resolution contains the explicit error:
agents.max_threads cannot be set when multi_agent_v2 is enabled
Relevant source:
- https://github.com/openai/codex/blob/main/codex-rs/core/config.schema.json
- https://github.com/openai/codex/blob/main/codex-rs/core/src/config/mod.rs
Why this is distinct from related issues
- Feature Request: Support for higher or configurable sub-agent spawning limits #16183 requested higher/configurable subagent limits.
- Main agent needs subagent capacity/status preflight before spawn_agent attempts #23479 requests runtime capacity/status preflight.
- MultiAgentV2 spawn_agent defaults to full-history fork, rejecting agent_type/model overrides #20077 covers
fork_turnsdefaulting to full-history fork.
This report is specifically about Desktop enabling/using MultiAgentV2 without exposing the effective configuration source or providing migration guidance from agents.max_threads.
Additional information
OpenAI Support confirmed that the currently available public documentation does not explain the migration relationship between agents.max_threads and max_concurrent_threads_per_session, and recommended filing the issue in this repository.
Activity
github-actions commentedon Jul 15, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
eureka-pd commentedon Jul 16, 2026
I filed #33512 as a narrower instance of this issue. After comparing the reports, I agree that it is substantially a subset of #33447.
The patch addresses the explicit-config conflict path corresponding to expected-behavior option 3. It changes the validation error to name:
features.multi_agent_v2.max_concurrent_threads_per_session
and explains that the v2 limit applies per session and includes the root thread.
Patch:
eureka-pd@edca81c
Validation:
just test -p codex-core multi_agent_v2
68 tests passed.
This does not address the broader Desktop behavior where MultiAgentV2 may be selected without exposing the effective configuration source. I will close #33512 as a duplicate and keep the patch discussion here.
If this narrow fix aligns with the intended solution, I would appreciate an invitation to open the pull request.
mbrq-cs commentedon Jul 16, 2026
Same for me. Feedback Id:
019f6446-090a-7880-a2fb-8562d44ca260ignatremizov commentedon Jul 16, 2026
A better workaround is to get multi agent v1 again for gpt-5.6-sol (which does not have this issue) by overriding models.json with a custom catalog (make a copy from source) and change multi_agent_version to null (so it's by config) or v1 (so it's by model catalog json), and disabling deferred tools search.
lirundong commentedon Jul 17, 2026
Confirmed independently on Linux with codex-cli 0.144.5 (exact source tag rust-v0.144.5).
Reproduction:
The 0.144.5 source explains the silent mismatch:
Relevant exact-version source:
codex/codex-rs/core/src/config/mod.rs
Lines 207 to 208 in 87db9bc
codex/codex-rs/core/src/config/mod.rs
Lines 1431 to 1443 in 87db9bc
codex/codex-rs/core/src/session/mod.rs
Lines 3109 to 3123 in 87db9bc
codex/codex-rs/core/src/session/mod.rs
Lines 450 to 465 in 87db9bc
The local workaround also succeeds here: remove agents.max_threads, then configure features.multi_agent_v2.enabled = true and features.multi_agent_v2.max_concurrent_threads_per_session = 13. codex features list now reports multi_agent_v2 true.
This confirms the issue is not limited to Windows/Desktop. The actionable fix would ideally warn or migrate whenever the resolved session version is V2 and agents.max_threads is present, even when V2 came from model metadata or resumed history rather than the local feature flag.
docs(orch): Codex thread cap is MultiAgentV2's configurable default; …
docs(orchestration): agent-orchestration landscape + native workflow …
feat(orch): absorb spawn choreography into a spawn-adapter helper (#900…
null0526 commentedon Aug 3, 2026
I can confirm that the underlying discoverability problem still exists on a newer Desktop/CLI build, although the configuration behavior has changed after the recent agent-setting unification.
Environment
26.727.6591.0codex-cli 0.146.0-alpha.9.2gpt-5.6-solCODEX_HOME:C:\Users\<redacted>\.codexWhat happened
New tasks could use only one subagent:
The failure was deterministic. While the first subagent was running, attempting to spawn a second immediately returned:
This was not a server-side account limit or a leaked agent slot. The effective user configuration contained:
I did not knowingly set this value. I cannot prove which Desktop version, migration, experiment, or prior process wrote it, so I am not claiming a specific origin.
Effective backend was not discoverable from
features listcodex features listreported:However, the actual session rollout explicitly recorded:
The task also exposed the V2 tool family, including
followup_task,interrupt_agent, andlist_agents.This confirms that the model catalog/session can select MultiAgent V2 independently of the user-visible feature flag. The rollout record was the authoritative evidence;
features listalone was misleading for diagnosing the active task.Configuration change
I replaced the legacy alias:
with the current canonical setting:
On this build, the setting counts subagents and does not include the root agent, so the resulting capacity is:
The current binary accepted the new key under
--strict-config. Deliberately changing the value to a string produced:so the field and its type were verified against the actual bundled runtime.
I also checked for command-line, profile, project-level
.codex/config.toml, system configuration, and managed-requirements overrides and did not find another concurrency source.Real concurrency verification
A fresh Codex process reloaded the configuration and reported:
It then successfully spawned four subagents before the first wait operation. Each ran a bounded 12-second probe:
All four intervals overlapped for approximately 2.06 seconds, confirming genuine four-subagent concurrency rather than serial reuse.
Existing Desktop tasks retained their creation-time two-slot configuration; only a fully restarted Desktop and newly created task used the new value.
Why this remains a product issue
The runtime configuration now works correctly once the relevant key is found. The unresolved problem is that Desktop and CLI diagnostics do not make the following visible:
In this case, a persistent
max_threads = 1silently reduced GPT-5.6 Sol to one subagent, whilefeatures listsuggested that V2 was disabled. Diagnosing the cause required inspecting rollout JSONL, testing the runtime configuration parser, and running a timed concurrency probe.Suggested improvement
Please expose the following in
codex doctor, debug-config output, or Desktop diagnostics:A warning would also be useful when a legacy alias produces an unusually restrictive value, especially when the active task is using model-selected V2 while
features listreports the explicit V2 flag as false.I can provide a Desktop feedback ID or sanitized rollout excerpts if maintainers need them, but I have not attached the complete rollout because it may contain unrelated conversation and local-path data.