Codex Desktop: MultiAgentV2 silently bypasses agents.max_threads with no migration warning

Open 💬 6 comments Opened Jul 15, 2026 by NIshibayashi-cs
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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 = 2

The 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_threads does 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

  1. Add this to ~/.codex/config.toml:

``toml
[agents]
max_threads = 10
max_depth = 2
``

  1. Fully restart Codex Desktop.
  2. Create a new Desktop task that can use subagents.
  3. Ask the root agent how many concurrency slots are available, or inspect the model-visible session instructions.
  4. Observe a total of four slots (root + three children), rather than the configured agents.max_threads value.
  5. Increase agents.max_threads, restart Desktop, and create another task.
  6. 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:

  1. migrate the value to the v2 setting;
  2. show an actionable startup warning naming the replacement key;
  3. reject the conflicting configuration with a clear error before the task starts; or
  4. 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 = 111

the local Codex configuration loader accepted the configuration:

  • codex features list reported multi_agent_v2 ... true;
  • codex doctor --summary reported config loaded; and
  • codex debug prompt-input probe produced:

``text
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:

  • MultiAgentV2ConfigToml defines max_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:

``text
agents.max_threads cannot be set when multi_agent_v2 is enabled
``

Relevant source:

Why this is distinct from related issues

  • #16183 requested higher/configurable subagent limits.
  • #23479 requests runtime capacity/status preflight.
  • #20077 covers fork_turns defaulting 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.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #33039

Powered by Codex Action

xQuester · 1 month ago

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:
https://github.com/xQuester/codex/commit/edca81c45fcdb4063561a92192fd2217119c949f

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 · 1 month ago

Same for me. Feedback Id: 019f6446-090a-7880-a2fb-8562d44ca260

ignatremizov · 1 month ago

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 · 1 month ago

Confirmed independently on Linux with codex-cli 0.144.5 (exact source tag rust-v0.144.5).

Reproduction:

  • ~/.codex/config.toml contained agents.max_threads = 13 and agents.max_depth = 2.
  • codex features list reported multi_agent_v2 as under development / false.
  • The active tool-backed session nevertheless received the V2 collaboration namespace and the model-visible instruction: There are 4 available concurrency slots, meaning that up to 4 agents can be active at once, including you.
  • The runtime enforced root + 3 subagents; attempting a fourth subagent failed with agent thread limit reached.
  • Restarting/resuming after changing the legacy setting did not increase capacity.

The 0.144.5 source explains the silent mismatch:

  1. DEFAULT_AGENT_MAX_THREADS is 6, but DEFAULT_MULTI_AGENT_V2_MAX_CONCURRENT_THREADS_PER_SESSION is 4.
  2. effective_agent_max_threads(MultiAgentVersion::V2) ignores agent_max_threads and instead uses multi_agent_v2.max_concurrent_threads_per_session minus one for the root.
  3. A selected model or resumed conversation can select/inherit MultiAgentVersion::V2 independently of features.multi_agent_v2 being enabled. Consequently, the explicit validation conflict is not triggered when the feature flag is false, even though the running session uses V2 and silently ignores agents.max_threads.

Relevant exact-version source:

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.

null0526 · 25 days ago

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

  • Codex Desktop: 26.727.6591.0
  • Bundled CLI/app-server: codex-cli 0.146.0-alpha.9.2
  • Windows, with the execution environment accessed through WSL
  • Model: gpt-5.6-sol
  • Effective CODEX_HOME: C:\Users\<redacted>\.codex

What happened

New tasks could use only one subagent:

root agent + 1 subagent = 2 active agents

The failure was deterministic. While the first subagent was running, attempting to spawn a second immediately returned:

agent thread limit reached

This was not a server-side account limit or a leaked agent slot. The effective user configuration contained:

[agents]
max_threads = 1

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 list

codex features list reported:

multi_agent = true
multi_agent_v2 = false

However, the actual session rollout explicitly recorded:

multi_agent_version: v2

The task also exposed the V2 tool family, including followup_task, interrupt_agent, and list_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 list alone was misleading for diagnosing the active task.

Configuration change

I replaced the legacy alias:

[agents]
max_threads = 1

with the current canonical setting:

[agents]
max_concurrent_threads_per_session = 4

On this build, the setting counts subagents and does not include the root agent, so the resulting capacity is:

1 root + 4 subagents = 5 active agents

The current binary accepted the new key under --strict-config. Deliberately changing the value to a string produced:

expected usize

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:

5 available concurrency slots, including you

It then successfully spawned four subagents before the first wait operation. Each ran a bounded 12-second probe:

A 1785725637.111 → 1785725649.115
B 1785725643.755 → 1785725655.758
C 1785725644.525 → 1785725656.528
D 1785725647.056 → 1785725659.059
OVERLAP_ALL4=true

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:

  1. the actual multi-agent version selected for the current task;
  2. the effective subagent concurrency limit;
  3. whether the value came from a canonical key, legacy alias, model metadata, session history, managed policy, or another configuration layer;
  4. whether a legacy persisted value was migrated or preserved;
  5. that existing tasks retain their creation-time limit and require a new task after restart.

In this case, a persistent max_threads = 1 silently reduced GPT-5.6 Sol to one subagent, while features list suggested 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:

Effective multi-agent version: v2
Selection source: model catalog / session / explicit feature
Effective maximum subagents: 1
Configuration source: C:\Users\<redacted>\.codex\config.toml
Source key: agents.max_threads (legacy alias)
Task configuration snapshot: restart and create a new task to apply changes

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 list reports 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.