[Bug] Teammate process crashes on permission prompt with Ink rendering error: <Box> nested in <Text>
Bug Description
Title: Spawned teammate crashes at startup with Ink error <Box> can't be nested
inside <Text> (v2.1.119, --teammate-mode tmux)
Version: 2.1.119
Platform: macOS 15.5 (Darwin 25.5.0), iTerm2 stable, zsh
Flags/env: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, launched with claude
--teammate-mode tmux
iTerm2: Python API enabled; it2 CLI v0.2.3 installed and working (it2 session list
returns sessions)
Summary:
Spawned teammates in --teammate-mode tmux crash at startup with an Ink rendering
error. The teammate process dies before doing any work, so the lead session sees
only silence — indistinguishable from a stuck agent. This has been masking as
"debate MCP hangs" and "Opus reasoning loops" in our debugging for multiple
sessions.
Crash:
ERROR <Box> can't be nested inside <Text> component
/$bunfs/root/src/entrypoints/cli.js:502:249
Stack:
createInstance (/$bunfs/root/src/entrypoints/cli.js:502:249)
PL (/$bunfs/root/src/entrypoints/cli.js:484:58456)
LYH (/$bunfs/root/src/entrypoints/cli.js:484:88642)
rZH (/$bunfs/root/src/entrypoints/cli.js:484:87842)
RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)
iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)
jM_ (/$bunfs/root/src/entrypoints/cli.js:484:83272)
aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)
LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)
FH (/$bunfs/root/src/entrypoints/cli.js:484:5318)
Repro:
- Launch CC with --teammate-mode tmux and CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
- TeamCreate({ team_name: "test", agent_type: "lead" })
- Spawn teammate: Agent({ name: "x", team_name: "test", subagent_type:
"general-purpose", model: "haiku", run_in_background: true, prompt: "run python3 -c
'print(1)'" })
- The teammate's first Bash call requires permission. The permission-prompt UI
triggers the Ink crash; the teammate pane dies.
In my reproducing case the teammate's first tool call was python3 << EOF ...
(market-hours detection). Any non-allowlisted Bash works.
Impact:
- Any Agent Teams workflow that's not fully pre-allowlisted crashes on first
permission prompt.
- The lead has no direct signal that the teammate died — reads as a hang.
- Existing silence-watchdogs (15+ min thresholds) misdiagnose as stuck-agent and
retry, compounding confusion.
- Debugging assumed Opus reasoning loops / MCP hangs; actual cause was this crash.
Requests:
- Fix the Ink layout on the permission-prompt / startup path — <Box> is nested
inside <Text> somewhere in that component tree.
- When a teammate exits unexpectedly, emit a TEAMMATE_CRASHED system message to
the lead's inbox with exit code + last stderr. Right now crash and silence are
indistinguishable from the lead side.
- Optional: ship source maps / a less-minified build so cli.js:502:249 is
actionable.
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.119
- Feedback ID: 7244c4f7-de93-4d77-b2c1-af8f7fed762d
Errors
[{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at TWH (/$bunfs/root/src/entrypoints/cli.js:2736:30496)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T03:33:53.938Z"},{"error":"Error: Tool mcp__PAL__listmodels not found\n at Uj7 (/$bunfs/root/src/entrypoints/cli.js:3077:31268)\n at kz (/$bunfs/root/src/entrypoints/cli.js:484:21134)\n at P1 (/$bunfs/root/src/entrypoints/cli.js:484:39900)\n at M9H (/$bunfs/root/src/entrypoints/cli.js:484:50713)\n at rZH (/$bunfs/root/src/entrypoints/cli.js:484:87780)\n at RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)\n at iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)\n at jM_ (/$bunfs/root/src/entrypoints/cli.js:484:82889)\n at aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)\n at LH (/$bunfs/root/src/entrypoints/cli.js:484:5006)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18721:2361)","timestamp":"2026-04-24T03:33:55.083Z"},{"error":"Error: Tool mcp__debate__listmodels not found\n at Uj7 (/$bunfs/root/src/entrypoints/cli.js:3077:31268)\n at kz (/$bunfs/root/src/entrypoints/cli.js:484:21134)\n at P1 (/$bunfs/root/src/entrypoints/cli.js:484:39900)\n at M9H (/$bunfs/root/src/entrypoints/cli.js:484:50713)\n at rZH (/$bunfs/root/src/entrypoints/cli.js:484:87780)\n at RD6 (/$bunfs/root/src/entrypoints/cli.js:484:86738)\n at iZH (/$bunfs/root/src/entrypoints/cli.js:484:86558)\n at jM_ (/$bunfs/root/src/entrypoints/cli.js:484:82889)\n at aH (/$bunfs/root/src/entrypoints/cli.js:484:6552)\n at LH (/$bunfs/root…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗