[Bug] Agent Teams launch crashes with Ink renderer: Box nested inside Text component

Resolved 💬 3 comments Opened Apr 27, 2026 by russellbrenner Closed Apr 28, 2026

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"}]

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗