Skip to content

core: box multi-agent handler futures#22266

Merged
bolinfest merged 1 commit into
mainfrom
pr22266
May 13, 2026
Merged

core: box multi-agent handler futures#22266
bolinfest merged 1 commit into
mainfrom
pr22266

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented May 12, 2026

Why

This is the base PR in the split stack for the permissions migration. It isolates stack-safety work that had been mixed into the larger permissions PR, so reviewers can evaluate the async-future changes separately from the permissions model changes in #22267.

The main risk this addresses is large or recursive multi-agent futures overflowing smaller runner stacks. A follow-up review also called out that shutdown_live_agent must remain quiescent: callers should not remove a live agent from tracking or release its spawn slot until the worker loop has actually terminated.

What Changed

  • Boxes the large async futures in the multi-agent spawn, resume, and close tool handlers.
  • Boxes the AgentControl spawn and recursive close/shutdown paths that can otherwise build very deep futures.
  • Keeps shutdown_live_agent waiting for thread termination before removing/releasing the live agent, preserving the previous shutdown ordering while still boxing the recursive close path.

Verification Strategy

The focused local coverage was cargo test -p codex-core multi_agents, which exercises the multi-agent spawn/resume/close handlers, cascade close/resume behavior, and the shutdown path touched by this PR.


Stack created with Sapling. Best reviewed with ReviewStack.

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: 44831f4b8a

ℹ️ 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.rs Outdated
@bolinfest bolinfest merged commit 9e7cdbd into main May 13, 2026
44 of 66 checks passed
@bolinfest bolinfest deleted the pr22266 branch May 13, 2026 00:22
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 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