Skip to content

multi_agent_v2: move thread cap into feature config#19792

Merged
jif-oai merged 4 commits intomainfrom
jif/clean-multi-agent-v2-config
Apr 27, 2026
Merged

multi_agent_v2: move thread cap into feature config#19792
jif-oai merged 4 commits intomainfrom
jif/clean-multi-agent-v2-config

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented Apr 27, 2026

Why

features.multi_agent_v2.max_concurrent_threads_per_session is meant to be the MultiAgentV2-specific session thread cap: it counts the root thread and all open subagent threads. The previous implementation kept this surface tied to agents.max_threads, which made it a global subagent-only cap and allowed the legacy setting to coexist with MultiAgentV2.

What Changed

  • Added max_concurrent_threads_per_session to [features.multi_agent_v2] with default 4.
  • Removed the [agents] max_concurrent_threads_per_session alias to agents.max_threads.
  • When MultiAgentV2 is enabled, reject agents.max_threads and derive the existing internal subagent slot limit as max_concurrent_threads_per_session - 1.
  • Regenerated core/config.schema.json and added coverage for the new config semantics.

Result

➜  codex git:(jif/clean-multi-agent-v2-config) codex -c features.multi_agent_v2.enabled=true -c features.multi_agent_v2.max_concurrent_threads_per_session=3
╭────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.0.0)                           │
│                                                    │
│ model:     gpt-5.5 xhigh   fast   /model to change │
│ directory: ~/code/codex                            │
╰────────────────────────────────────────────────────╯

  Tip: Update Required - This version will no longer be supported starting May 8th. Please upgrade to the latest version (https://github.com/openai/codex/releases/latest) using your preferred package manager.

› Can you try to spawn 4 agents


• I’ll try to start four lightweight agents at once and report exactly what the runtime accepts.

• Spawned Russell [no-apps] (gpt-5.5 xhigh)
  └ Spawn probe 1: reply briefly that you started, then wait for further instructions. Do not do any repo work.

• Spawned Descartes [no-apps] (gpt-5.5 xhigh)
  └ Spawn probe 2: reply briefly that you started, then wait for further instructions. Do not do any repo work.

• Agent spawn failed
  └ Spawn probe 3: reply briefly that you started, then wait for further instructions. Do not do any repo work.

• Agent spawn failed
  └ Spawn probe 4: reply briefly that you started, then wait for further instructions. Do not do any repo work.

• The runtime accepted the first two and rejected the next two with agent thread limit reached. I’m checking whether the two accepted probes have returned cleanly, then I’ll close them if needed.

@jif-oai jif-oai requested a review from a team as a code owner April 27, 2026 08:38
@jif-oai jif-oai changed the title chore: clean and fix max_concurrent_threads_per_session multi_agent_v2: move thread cap into feature config Apr 27, 2026
jif-oai and others added 2 commits April 27, 2026 09:46
Keep the feature-config thread-cap changes scoped to config and runtime behavior, while restoring the spawn-agent tool description text and plumbing to the prior branch behavior.

Co-authored-by: Codex <noreply@openai.com>
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Apr 27, 2026

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 467e4641ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/config/src/key_aliases.rs
@jif-oai jif-oai merged commit f8c527e into main Apr 27, 2026
35 of 36 checks passed
@jif-oai jif-oai deleted the jif/clean-multi-agent-v2-config branch April 27, 2026 11:31
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants