Implement spawn subagent tool#23876
Conversation
Validation ReportAll 21 validations passed. Show details
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5757e5e7c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| f"('{self.name}' is not allowed in 'tools')." | ||
| ), | ||
| ) | ||
| disallowed = sorted(set(tool_input.tools) - self._allowed_tools) |
There was a problem hiding this comment.
Restrict subagents to the current run's tools
When a caller runs ReActProcess.start(..., allowed_tools=["spawn_subagent"]) or another per-task subset, this validation still compares the child request against _allowed_tools captured from the full registry at construction time. That lets the parent invoke spawn_subagent and ask the child for tools that were intentionally hidden for the current run, bypassing the allowed_tools restriction documented on ReActProcess.start; the effective child allowlist needs to be intersected with the current run's allowlist before building the subagent.
Useful? React with 👍 / 👎.
This stack of pull requests is managed by Graphite. Learn more about stacking. |

What does this PR do?
Motivation
Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged