Skip to content

Parallel sub-agents missing from UI tree due to React key prop error #1700

@bsauvage1

Description

@bsauvage1

Description

When a custom orchestrator agent launches 3+ sub-agents simultaneously via the task tool with mode: "background", one or more child agents are missing from the terminal UI tree. The agents run and complete successfully — their results appear in the final output — but the live display drops them.

Steps to Reproduce

  1. Configure a custom orchestrator agent that launches 3 sub-agents in parallel (e.g. code-reviewer-opus, code-reviewer-codex, code-reviewer-gemini) using the task tool with mode: "background"
  2. Run the orchestrator
  3. Observe the UI tree — only 2 of 3 child agents are displayed

Expected: All 3 sub-agents appear as children in the UI tree
Actual: Only 2 appear (in my case, opus was missing)

UI Display (what the user sees)

● Code-review-orchestrator: Review test_fibonacci.py
  ● Code-reviewer-codex: Review Fibonacci module
    └ ## Summary
  ● Code-reviewer-gemini: Review Fibonacci module
    └ Here is the complete review...

Note: code-reviewer-opus is missing despite running successfully.

Log Evidence

All 3 agents launched at the exact same millisecond and initialized correctly:

05:40:16.276Z [INFO] Task tool invoked with agent_type: code-reviewer-opus
05:40:16.276Z [INFO] Task tool invoked with agent_type: code-reviewer-codex
05:40:16.276Z [INFO] Task tool invoked with agent_type: code-reviewer-gemini
05:40:16.718Z [INFO] Custom agent "code-reviewer-codex" using tools: glob, view
05:40:16.754Z [INFO] Custom agent "code-reviewer-opus" using tools: grep, glob, view
05:40:17.224Z [INFO] Custom agent "code-reviewer-gemini" using tools: grep, glob, view

141ms after the 3 agents spawned, a React rendering error:

05:40:16.357Z [ERROR] Each child in a list should have a unique "key" prop.
                      Check the render method of `Box`. It was passed a child from san.

The final unified report includes findings from all 3 reviewers, confirming opus ran and completed — it just wasn't rendered.

Root Cause

The Ink (React for terminals) Box component that renders the agent tree doesn't assign unique key props to dynamically added child agent components. When multiple children are added in the same render cycle, React can't differentiate them and drops one.

Suggested Fix

Add key={agentId} (or similar unique identifier) to each child component in the agent tree Box renderer.

Environment

  • Copilot CLI version: 0.0.418
  • Node.js: v24.11.1
  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions