Multi agent orchestrator#5190
Conversation
|
Please make it be able to use a different model than its parent |
Will do. My idea is that agents should have its own config.toml to configure them in exactly same way as base codex. |
Sounds good. We should be able to even set a different Base URL, API key and model for the subagents, to combine different providers and have a powerful orchestration system |
subagent can just use a different profile. Currently I am using Codex as mcp server in claude code with different profile for different models and config. |
c38c76d to
4329bdc
Compare
|
Made a feature that allows switching into a child agent and working in it as in usual Codex, then returning to the main agent with the context collected in the sub agent. For fine-grained control over sub agents. To use, run /agent and select the agent to enter in to. |
That is a novelty. Haven't seen any other tool do that. Really interesting |
|
i really hope all this work is appreciated and considered to be merged by the OpenAI Codex team |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting |
@MasterMind7777777 & @alexx-ftw. Wouldn't it be typical that one wouldn't want this? I could very well me missing something, but as I understand it, one of the core benefits of subagents is you keep the context paired down and clean in the parent agent, it doesn't receive the entire context of the subagent but only a summary which the subagent generates. Alternative to a subagent summary, I could see a highly compacted context also be useful (which effectively acts as a summary). What is the scenario which one would want the full context of the subagent? I suppose if the context is small enough or the LLM is large and good enough it wouldn't matter. I also wanted to tag a previous discussion I've had on subagents for a different project (bosun-ai/kwaak#352) @MasterMind7777777 maybe you will find some of that discussion useful or relevant |
Main Agent/Orchestrator still gets a summary. But this solution allows the human to control the subagent when wanted the same as it does with the main Agent, and then go back |
Sub agents have their own context that they maintain (separate from parent agent) they only give last thing they produced as per request of main agent. But if you have seen their response of sub agent is bad, not what you expected then you might want to enter that agent to correct it by sending one or multiple clarifications so result that this sub agent provides to main agent is what you been looking for, and main agent using this updated response of subagent can handle final problem. |
|
OHHH I actually misunderstood what was being talked about (whoops!). Basically this is a feature with human interaction inside of the subagent... sounds useful. So is would the workflow as I imagine it:
Is that workflow correct? what happens to the main context on subagent re-prompt? You know what would be interesting too, to be able to have the main agent reprompt the subagent directly if it notices somethings is amiss with the subagent output. For a future PR though. |
|
nice contribution. This sounds like an exciting feature. Hope it works out good. |
Yah that is how it works. Except context of parent agent is not cleared/altered when you come back from sub agent. Just not sure yet how will it look; if you enter agent after chatting with main agent for long time. Should we really wipe main context to that point where you last used that specific sub agent? |
To me it makes more sense to wipe the entire subagent chat history and reload the main agent chat, just like we do now when resuming a conversation/session |
If we do that, there will be no way to bring context back from sub agent in to parent agent. So essentially work user done in sub agent will be lost and will not affect what happens in main agent. It might be useful in some use cases, but in others you might want to bring something back from sub agent to main agent. |
|
Another option would be to set up tool for sub agent to communicate to parent agent explicitly. So it would be up to model what to serve upstream. Than you would be able to chat to sub agent without worrying about what context you want to be sent back to parent. But that will lose out on control over agents. |
Maybe I didn't explain myself properly: |
Subagents could be running in the background performing their tasks, and the main agent could probe their progress at any point, or trigger them to provide a summary of the work done so far and whats missing, send them corrective instructions, and also the main agent receive a trigger once the subagent has marked its work as 100% done. |
That is how it works right now. So when main agent invokes sub agent it prompts it, sub agent thinks, does its thing, than finally provides response(final result) we take that final result and feed it in to main agent and main agent continues working. |
Not shure if its possible to let model to terminate/correct in-flight agent, it would need to wait for agent turn to finish and than act on it, by accepting result and proceeding or asking follow up to agent. As per what agents can can spawn [multi_agent]
agents = ["request_summarizer", "ideas_provider", "critic"]than sub agent ideas_provider config.toml would have its own agent set up [multi_agent]
agents = ["creative_ideas", "conservative_ideas"]so you can set up what sub agents can each agent invoke. |
|
Allthough i did add capability to run detached agent that is not awaited by parent agent. So it is none blocking agent run that you may or may not join(only final responce, no intermidiate thinking) in main agent context. |
|
Well apparently new features aren't been considered by openai (see the other multi-agent PR). time 2 ✌️ |
|
Thanks for the contribution, and apologies for the slow response. We've received many PRs, and we don't have the bandwidth on the codex team to review all of them. We've updated our contribution guidelines to clarify that we're currently accepting contributions for bugs and security fixes, but we're not generally accepting new features at this time. We need to make sure that all new features compose well with both existing and upcoming features and fit into our roadmap. If you would like to propose a new feature, please file or upvote an enhancement request in the issue tracker. We will generally prioritize new features based on community feedback. |
|
Wasting other people's time |
|
It's probably best to create a fork :) The "just-every/code" fork is doing pretty good too |
Summary
delegate_agenttool so the main Codex assistant can launch sub-agents without user prompts or MCP plumbingai-temp/temporarily while the architecture settles (they will move or vanish before GA)ai-temp/example-conversation.mdto demonstrate the ideas-provider → critic workflow end-to-endWhy
Deep, specialized operations exhaust the primary context or dilute instructions. By shunting targeted work to sub-agents, we:
Status
Work in progress. Delegation already functions for read-only demos, but polished instructions, diagnostics, and more sampling are still ahead.
Usage
See
ai-temp/example-conversation.mdfor a complete transcript exercising ideas-provider → critic delegation.Testing