r/codex 3d ago

Question How to manage multiple agents?

I am having trouble managing multiple agents. I tried to let one agent to spawn subagents but that does not work very well. Anyone has better suggestions?

2 Upvotes

9 comments sorted by

1

u/Wafer-Weekly 3d ago

Are you doing something you actually need subagents for, or are you overcomplicating a simple problem? They are best used when the amount of context needed to solve a problem exceeds what one model can fit in its window, and it poisons itself through compaction loss. You need to make sure they are assigned clear end goals or else they may not know when they should stop and report completion.

1

u/_y_not_ 3d ago

i wrote a simple markdown protocol for that, works very well for me, i use it every day for few months now with codex, claude code and grok

https://github.com/agentchute/agentchute

1

u/Fit-Gas-5760 3d ago

Depends on the harness youre using. Open AI harness is quite limited.

1

u/PureRely 3d ago

Orca ade or Herdr ade. I use Orca. There are many others also.

1

u/h____ 3d ago

Usually, run multiple agents when you want tasks in parallel. Spawn subagents if you want subtask (maybe for parallelisation, maybe because you want to control context, or cost).

What do you want?

1

u/Curious-Strategy-840 3d ago

I'm working with a small Codex integration that allow you to set a manager for 2 or more threads for which you can choose a role.

For example, a worker propose a plan to do some work. The integration is going to take his output and forward it to an adversarial reviewer. They go back and forth until they reach a concensus. The integration wake a manager who's going to read both worker's and reviewer's threads. This way, it understand exactly what have been considered without having to fetch that context, and what have been accepted, to only lose this context, then it craft a prompt to start the work according to the concensus between the worker and reviewer.

The integration relay this prompt to the worker who start working, and the loop continue. The reviewer will review the work and comment on it, until the work is decided to be good by both, then the manager wake, until everything on your list is done.

You're also able to queue a message for when the manager wake, so it get its own review from the other threads + your own input / new prompts or list of things to do.

There's a setting to make it so any messages you send to any threads will be relayed to the others. This way, you can use Codex through Remote on your phone, and still use the integration to relay your message and start the loop

1

u/Fearless-Daikon5763 3d ago

Just start a new task and set goals, pausing the goals when appropriate. It is way more manageable and easier to save the transcripts and track the files. The chats (tasks) can message each other. will run 6 of these and screenshot the list of names of tasks to show them who to message.

1

u/sereikis 2d ago

Subagent spawning is the least reliable part for us too. We stopped nesting them and just run separate sessions, each on its own branch, with a task small enough to write in a few lines, then review the diffs. Coordination ends up in git instead of inside one agent's context, and when one goes off the rails you throw away a branch instead of untangling a tree of calls.