Skip to content

feat: count V2 concurrency by active execution#26969

Merged
jif-oai merged 9 commits into
mainfrom
jif/residency
Jun 8, 2026
Merged

feat: count V2 concurrency by active execution#26969
jif-oai merged 9 commits into
mainfrom
jif/residency

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Why

Multi-Agent V2 concurrency should count active non-root turns, not resident or durable agent threads. The limit is intentionally best effort: admission checks are synchronous, but concurrent successful checks may overshoot slightly.

What changed

  • Keep one root-derived execution limit on the shared AgentControl.
  • Count active V2 subagent turns with an RAII guard owned by RunningTask.
  • Check capacity before spawning or starting an idle agent, including direct app-server turn/start submissions.
  • Preserve queued delivery for agents that are already running.
  • Exempt automatic idle continuations so /goal work is not dropped when capacity is temporarily full.
  • Keep root and V1 turns outside this limiter.

Test coverage

  • execution_guards_count_active_v2_subagent_turns
  • execution_guards_ignore_root_and_v1_turns
  • v2_nested_spawn_checks_shared_active_execution_capacity

@jif-oai jif-oai requested a review from a team as a code owner June 8, 2026 08:56
@jif-oai jif-oai changed the title feat: residency feat: count V2 concurrency by active execution Jun 8, 2026

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

Copy link
Copy Markdown
Contributor

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: a66741fc04

ℹ️ 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/core/src/agent/control/execution_tests.rs Outdated
Comment thread codex-rs/core/src/tasks/mod.rs Outdated
Comment thread codex-rs/core/src/agent/control/spawn.rs Outdated
Comment thread codex-rs/core/src/agent/control/execution.rs Outdated
@jif-oai

jif-oai commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

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

Copy link
Copy Markdown
Contributor

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: 4fcd8712ac

ℹ️ 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/core/src/agent/control/execution.rs Outdated
Comment thread codex-rs/core/src/agent/control/execution_tests.rs Outdated
Comment thread codex-rs/core/src/agent/control/execution_tests.rs
Comment thread codex-rs/core/src/agent/control/execution.rs Outdated
@jif-oai

jif-oai commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

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

Copy link
Copy Markdown
Contributor

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: 28d5be3673

ℹ️ 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/core/src/session/inject.rs Outdated
Comment thread codex-rs/core/src/tasks/mod.rs Outdated
Comment thread codex-rs/core/tests/suite/agent_execution.rs Outdated
Comment thread codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs Outdated
@jif-oai

jif-oai commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

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

Copy link
Copy Markdown
Contributor

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: 37a985e98f

ℹ️ 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/core/src/agent/control/execution.rs Outdated
Comment thread codex-rs/core/src/tasks/mod.rs
@jif-oai

jif-oai commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

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

Copy link
Copy Markdown
Contributor

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: 36dcfa4bf3

ℹ️ 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/core/src/codex_thread.rs
Comment thread codex-rs/core/src/codex_thread.rs
Comment thread codex-rs/core/src/agent/control/execution.rs
@jif-oai jif-oai merged commit 743f5aa into main Jun 8, 2026
29 checks passed
@jif-oai jif-oai deleted the jif/residency branch June 8, 2026 12:21
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants