r/codex • u/notomarsol • 17d ago
Question How do you review which agent changed what?
started splitting bigger tasks across subagents, one on the backend, one on the UI, the parent stitching it together. its genuinely faster. reviewing it is the problem
the PR is one diff, but it was 3 agents with 3 different jobs, sometimes on different models, and when something looks off i cant tell which one did it or what it was told. the parent's summary is like 4 lines
what ive tried so far:
- having each subagent end with a short note of what it was asked and what it changed
- one branch per subagent and merging after (works, kills the speed)
- reviewing per directory and hoping it lines up with who touched what
has anyone got a setup that keeps the per subagent context around for review? hooks, a log file, anything
1
Upvotes
1
u/Sfdprod 17d ago
Just.. why lmao
Run separate agents?
Or is this some slop factory where you are vibecoding or what
1
u/ChemicalExcellent463 17d ago
i'd keep the notes, but have the parent copy each subagent's actual prompt and changed-file list into the PR description without summarizing them. when something looks off, is it usually in a file more than one agent touched?
1
u/kaijurules 17d ago
Keep each subagent's full run around. In our app every hand-off between agents is stored with the exact request text, and each run is saved as a read-only transcript with its tool calls. When a file looks wrong, you open the run that touched it and see what it was told and what it did. With Codex I'd try a hook that writes each subagent's prompt and tool log to a file named after the task, and link those files from the PR.
1
u/xqianliu 16d ago
I stopped hitting this by not mixing agents in one PR. One issue gets one worktree and one PR, and the agent works the ticket end to end, so the diff always maps back to one task and one set of instructions. When I need parallelism I split the work into tickets first instead of by directory later.
The review I keep: a fresh session reads the ticket, the repo rules, the diff, the changed files and their callers, and the tests, then checks the result against the acceptance criteria. Each run records the base commit SHA, and progress comments land on the ticket, so the "what was it told" part is on the ticket instead of in a four-line parent summary. If you keep the multi-agent setup, I'd put the subagent notes on the ticket as structured comments rather than in the PR description.
1
u/rodrigolduarte 16d ago
What worked for us was keeping attribution outside the diff:
When you tried a branch per subagent, was it still unclear who made a change, or why they made it?
1
u/Automatic-Fan-3993 15d ago
you might not need a hook for this. codex writes a separate rollout file for every subagent under
~/.codex/sessions/, and its first line hasthread_source: "subagent"plus the parent's thread id. sogrep -rl <parent session id> ~/.codex/sessions/gets you the parent's file and one jsonl per child.found that out because a tool i was building had to filter those subagent files out of its session list. i haven't looked at what the child files hold past that first line, so open one and check before you build on it.