claude-code - 💡(How to fix) Fix [Bug] Agent Teams launch crashes with Ink renderer: Box nested inside Text component [2 comments, 3 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#53771Fetched 2026-04-28 06:47:40
View on GitHub
Comments
2
Participants
3
Timeline
9
Reactions
1
Timeline (top)
labeled ×5commented ×2closed ×1subscribed ×1

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/rbrenner/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-27T06:36:17.630Z"}]

Root Cause

Root cause hypothesis for the report: a Teams UI component rendered a Box inside a Text component when displaying either the agent metadata, task status, or failure output. The task itself is unlikely to be the cause.

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/rbrenner/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n    at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n    at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-27T06:36:17.630Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description Report-ready version:

Title: Claude Code 2.1.119 agent launch crashes with Ink renderer invariant: "<Box> can't be nested inside <Text> component"

Product: Claude Code Version: 2.1.119 Runtime: Bun-packaged Claude Code binary Mode: Agent Teams enabled Platform: macOS Command context: launching a team sub-agent

Command:

cd /Users/rbrenner/git/homelab/.claude/worktrees/vault-fix &&
env CLAUDECODE=1
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
ANTHROPIC_BASE_URL=https://litellm.redacted.com
/Users/rbrenner/.local/share/claude/versions/2.1.119
--agent-id secret-ref-agent@redacted-vault-pr21
--agent-name secret-ref-agent
--team-name redacted-vault-pr21
--agent-color blue
--parent-session-id 37250bd1-26aa-4d34-a38a-853d53f333e0
--agent-type Explore
--model sonnet

Observed behaviour:

The agent process crashes immediately with:

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

Stack points to the bundled CLI Ink renderer:

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

Relevant frame:

createInstance(...) { if (K.isInsideText && H === "ink-box") throw Error("<Box> can't be nested inside <Text> component"); }

Impact:

The parent session believed the agent had spawned, but the worker did not complete its task and did not write its expected findings file. Task state remained in_progress until manually detected and reassigned to a replacement agent.

Why this appears to be a Claude Code bug:

The crash occurs inside the terminal UI renderer while rendering agent/team UI state, before the agent performs task logic. The user prompt and agent task should not be able to cause an Ink component nesting invariant violation. Even if bad agent metadata or prompt content triggers the render path, Claude Code should render safely or degrade gracefully rather than terminating the child agent process.

Relevant metadata:

  • Agent ID: secret-ref-agent@redacted-vault-pr21
  • Agent name: secret-ref-agent
  • Team name: redacted-vault-pr21
  • Agent type: Explore
  • Agent colour: blue
  • Parent session ID: 37250bd1-26aa-4d34-a38a-853d53f333e0
  • Experimental flag: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  • Base URL: ANTHROPIC_BASE_URL=https://litellm.redacted.com

Expected behaviour:

Agent launch should not crash the CLI renderer. If the renderer encounters invalid UI structure, it should either:

  1. avoid rendering the invalid nested component,
  2. show a non-fatal error in the parent session, or
  3. mark the agent launch as failed so task state does not remain misleadingly in progress.

Root cause hypothesis for the report: a Teams UI component rendered a Box inside a Text component when displaying either the agent metadata, task status, or failure output. The task itself is unlikely to be the cause.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.119
  • Feedback ID: 210b26a4-e222-42a0-b871-5ee993ef7632

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/rbrenner/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n    at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n    at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-27T06:36:17.630Z"}]

extent analysis

TL;DR

The issue is likely caused by an invalid UI structure in the Teams UI component, where a Box is nested inside a Text component, and can be fixed by modifying the rendering logic to handle such cases.

Guidance

  • Investigate the rendering logic in the entrypoints/cli.js file, specifically the createInstance function, to understand how the UI components are being rendered and why the Box is being nested inside a Text component.
  • Check the agent metadata, task status, and failure output to see if any of these contain invalid UI structures that could be causing the issue.
  • Consider adding error handling to the rendering logic to catch and handle cases where invalid UI structures are encountered, rather than crashing the CLI renderer.
  • Review the experimental flag CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to see if it is related to the issue and if disabling it resolves the problem.

Example

No code example is provided as the issue is related to a specific implementation detail in the entrypoints/cli.js file, which is not publicly available.

Notes

The issue seems to be related to a specific implementation detail in the Claude Code UI rendering logic, and without access to the code, it is difficult to provide a more detailed solution. Additionally, the issue may be specific to the experimental feature CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS, and disabling it may resolve the problem.

Recommendation

Apply a workaround by modifying the rendering logic to handle invalid UI structures, as the root cause of the issue is likely related to the UI rendering and not a simple configuration change.

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] Agent Teams launch crashes with Ink renderer: Box nested inside Text component [2 comments, 3 participants]