Two agent instances are running in parallel on the same repository. Agent A is refactoring the payment module, and Agent B is adding new features to the same module. What configuration is required to prevent them from interfering with each other?
Select an answer to reveal the explanation.
Short Explanation
Two surgeons can't operate on the same incision at the same time without chaos — they need separate operating theaters. You need to give each agent its own isolated branch, workspace, and PR, then use merge policies to control when and how changes come together.
Full Explanation
Agent isolation for parallel execution is achieved by scoping each agent to a separate Git branch, preventing interference at the file-system level.
Why the separate isolated branch configuration is correct: Configuring each agent to a separate branch (e.g., agent/payment-refactor and agent/payment-new-features) ensures that their file changes do not conflict during execution. Each agent can commit freely to its branch. Merge policies — such as requiring the refactoring PR to be reviewed and merged before the feature PR is rebased — enforce sequential integration of overlapping changes.
Why running both agents in the same branch and resolving conflicts manually after both complete is wrong: Running both agents on the same branch means their file writes will conflict in real time. One agent's changes can overwrite the other's, leading to corrupted, incomplete, or contradictory code.
Why configuring agents to share a single context window so they can coordinate their changes in real time is wrong: Sharing a single context window does not prevent file-system conflicts. Context windows are read-only representations of state — they do not coordinate writes between agents. And two agents sharing one context window creates coordination complexity without solving the core isolation problem.
Why assigning both agents to the same pull request so their changes are visible to each other is wrong: Assigning both agents to the same PR means their changes are combined in the same diff. The PR becomes difficult to review and conflicts between their changes are not isolated. Separate PRs allow each agent's work to be reviewed and integrated independently.