claude-code - 💡(How to fix) Fix [Bug] Teammate process crashes on permission prompt with Ink rendering error: <Box> nested in <Text> [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52704Fetched 2026-04-24 10:41:55
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×6commented ×1

Error Message

[{"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…

Code Example

[{"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…
RAW_BUFFERClick to expand / collapse

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:

  1. Launch CC with --teammate-mode tmux and CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  2. TeamCreate({ team_name: "test", agent_type: "lead" })
  3. Spawn teammate: Agent({ name: "x", team_name: "test", subagent_type: "general-purpose", model: "haiku", run_in_background: true, prompt: "run python3 -c 'print(1)'" })
  4. 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:

  1. Fix the Ink layout on the permission-prompt / startup path — <Box> is nested inside <Text> somewhere in that component tree.
  2. 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.
  3. 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.

extent analysis

TL;DR

The Ink rendering error causing teammate crashes at startup can be addressed by fixing the layout issue where a <Box> is nested inside a <Text> component.

Guidance

  1. Identify the problematic component: Review the code in cli.js around line 502 to find where the <Box> is being nested inside a <Text> component, which is causing the Ink rendering error.
  2. Fix the component tree: Modify the component tree to ensure that <Box> is not nested inside <Text>, as this is not a valid layout according to the error message.
  3. Implement error handling for teammate crashes: To improve debugging, consider implementing a system message (TEAMMATE_CRASHED) that is emitted to the lead's inbox when a teammate exits unexpectedly, including the exit code and last stderr output.
  4. Consider shipping source maps or less-minified builds: To make debugging easier, especially for issues like this where line numbers in minified code are provided, consider shipping source maps or less-minified builds of the code.

Example

No specific code example can be provided without knowing the exact structure of the components involved. However, the fix would involve rearranging the JSX or component structure to avoid the nesting issue. For example, if the problematic code looks something like <Text><Box>...</Box></Text>, it might need to be rearranged to <Box><Text>...</Text></Box> or another structure that does not nest <Box> inside <Text>.

Notes

  • The provided information does not allow for a precise code fix without access to the specific lines of code mentioned in the error stack.
  • The issue seems to be related to the rendering of the permission prompt UI, which triggers the Ink crash when a teammate is spawned and attempts to execute a command requiring permission.

Recommendation

Apply a workaround by pre-allowlisting all necessary Bash commands for teammates to avoid the permission prompt that

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Teammate process crashes on permission prompt with Ink rendering error: <Box> nested in <Text> [1 comments, 2 participants]