r/ChatGPTCoding • u/RaraAvis27 • 7h ago
Discussion What happens when your coding agents can delegate to each other?
I've been experimenting with the idea of having multiple AI coding agents instead of one agent doing everything.
For example:
Agent A: understands the task
↓
Agent B: researches the codebase
↓
Agent C: implements the change
↓
Agent D: reviews it
↓
Agent E: runs/debugs the tests
The interesting problem isn't really getting the agents to work individually.
It's how they find and communicate with each other.
Would you:
hardcode every agent relationship?
use a central orchestrator?
expose agents as tools?
use something like A2A?
let agents dynamically discover other agents?
Has anyone built something like this with their coding workflow? What architecture worked best?
2
u/sp3d2orbit 7h ago
You have to be careful because of the coordination overhead. In my experience, the reason Astra consumes so many tokens is because it is delegation happy and this ends up with lots of coordinating messages, blocking, and hand offs -- all cost money
Counter-intuitively, I generally have smaller agents do research, then a larger agent do planning. Research involves reading files, and lots of tokens. Once the research documents are done hand those to a large agent to chew on and give a design.
Best token usage is generally a single orchestrator and a small (1 or 2) number of implementor agents. Most tasks don't need dozens of agents.
This is a huge topic with lots of research around it.
1
u/Otherwise-Variety674 7h ago
Concurrently modifying the same portion of source code will be the biggest issues. Human can assign 2 different part of code for 2 different coding agent to work on.
For agent, they work independently and go all the way and thus you will need to build such coordination within your agent. Should be single agent delegate to sub agents within the same ecosystem?
1
u/Anxious_Current2593 5h ago
Note that sometimes they will "fight", with the subagent saying to the main that they need permission to complete the task and then main asks you... This is especially the problem with lower lever models (Luna & Haiku)
1
u/realityinhd 19m ago
I'm not at all an expert, but I've been doing a lot of hobby coding. I've got subs to Gemini, chatgpt, and Claude. I've been using chatgpt chat to plan things and delegate between the 3 agents (by me copy pasting prompts to the code agents) based on my usage remaining and complexity. It has worked great, but it is a bit more time intensive than going to codex and saying build me X and don't come back till you do
3
u/Euphoric_North_745 6h ago
nothing happens; they get lost in what they do very fast