claude-code - 💡(How to fix) Fix [BUG] Ink rendering crash "<Box> can't be nested inside <Text>" when teammate requests sandbox bypass permission [2 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#52431Fetched 2026-04-24 06:07:26
View on GitHub
Comments
2
Participants
2
Timeline
11
Reactions
0
Author
Timeline (top)
labeled ×7commented ×2cross-referenced ×1renamed ×1

When a teammate agent running in a sandboxed worktree attempts a command that requires out-of-sandbox permission (e.g., network access via curl), the permission-prompt UI crashes with an Ink rendering error. The teammate becomes unresponsive after the crash and does not process further messages, including shutdown_request.

Error Message

When a teammate agent running in a sandboxed worktree attempts a command that requires out-of-sandbox permission (e.g., network access via curl), the permission-prompt UI crashes with an Ink rendering error. The teammate becomes unresponsive after the crash and does not process further messages, including shutdown_request. ERROR <Box> can't be nested inside <Text> component

Root Cause

When a teammate agent running in a sandboxed worktree attempts a command that requires out-of-sandbox permission (e.g., network access via curl), the permission-prompt UI crashes with an Ink rendering error. The teammate becomes unresponsive after the crash and does not process further messages, including shutdown_request.

Code Example

{
     "subagent_type": "general-purpose",
     "team_name": "repro",
     "isolation": "worktree",
     "prompt": "Run: curl -s https://httpbin.org/get (no dangerouslyDisableSandbox)"
   }

---

ERROR  <Box> can't be nested inside <Text> component

 /$bunfs/root/src/entrypoints/cli.js:496:249
RAW_BUFFERClick to expand / collapse

Summary

When a teammate agent running in a sandboxed worktree attempts a command that requires out-of-sandbox permission (e.g., network access via curl), the permission-prompt UI crashes with an Ink rendering error. The teammate becomes unresponsive after the crash and does not process further messages, including shutdown_request.

Environment

  • Claude Code: 2.1.118
  • Platform: Linux (RHEL 9, kernel 5.14.0-570)
  • Bubblewrap: 0.4.1
  • CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  • Reproduces on both claude-opus-4-6[1M] and claude-opus-4-7[1M]

Reproduction

  1. TeamCreate({team_name: "repro"})
  2. Spawn a general-purpose teammate with worktree isolation:
    {
      "subagent_type": "general-purpose",
      "team_name": "repro",
      "isolation": "worktree",
      "prompt": "Run: curl -s https://httpbin.org/get (no dangerouslyDisableSandbox)"
    }
  3. The worktree's settings.local.json has sandbox.enabled: true with --unshare-net, so curl triggers a permission prompt for sandbox bypass.
  4. The teammate's tmux pane crashes with:
ERROR  <Box> can't be nested inside <Text> component

 /$bunfs/root/src/entrypoints/cli.js:496:249

Stack trace frames include createInstance, DI, SzH, WGH, oUH, rUH, Jp, tH, NH, oH at cli.js:478.

Impact

  • Teammate becomes completely unresponsive after the crash
  • Does not process subsequent messages or shutdown_request
  • Only recovery is killing the tmux pane manually
  • Does NOT occur when teammate runs on the main tree with sandbox disabled (no prompt = no crash)

Expected

The sandbox-bypass permission prompt should render correctly and allow the user to approve or deny.

Notes

  • A separate but related issue: the unresponsive teammate does not accept shutdown_request via SendMessage after the crash, so it cannot be cleaned up programmatically.

extent analysis

TL;DR

The issue can be mitigated by disabling the sandbox or modifying the settings.local.json to remove --unshare-net, allowing the teammate to access the network without triggering the permission prompt.

Guidance

  • Investigate the Ink rendering error and the stack trace to identify the root cause of the crash, focusing on the createInstance and DI functions in cli.js.
  • Verify that the issue is specific to the sandboxed worktree environment by comparing the behavior with a non-sandboxed setup.
  • Consider modifying the settings.local.json to remove --unshare-net or disable the sandbox to prevent the permission prompt from triggering.
  • Test the teammate's behavior with different isolation settings to determine if the issue is specific to worktree isolation.

Example

No code snippet is provided as the issue is related to a specific environment and configuration.

Notes

The issue seems to be related to the interaction between the sandbox, worktree isolation, and the permission prompt. Disabling the sandbox or modifying the settings.local.json may not be a permanent solution but can help mitigate the issue.

Recommendation

Apply workaround: disable the sandbox or modify the settings.local.json to remove --unshare-net, as this will prevent the permission prompt from triggering and causing the crash. This workaround can help mitigate the issue until a permanent fix is found.

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