Task tool: sporadic 500 Internal Server Error from subagent API calls

Resolved 💬 3 comments Opened Feb 25, 2026 by pstaylor-patrick Closed Feb 25, 2026

Description

When using the Task tool to spawn a subagent (specifically subagent_type: "code-review"), the API intermittently returns a 500 Internal Server Error. The error prevents the subagent from executing at all (0 tool uses, 0 tokens consumed).

Error

API Error: 500 {"type":"error","error":{"type":"api_error","message":"Internal server error"},"request_id":"req_011CYVACTvHhN1Y4LYQ7wGbN"}

Reproduction

  1. Use Claude Code CLI (Opus 4.6)
  2. Call Task tool with subagent_type: "code-review" and a prompt referencing a GitHub PR
  3. Error occurs on first attempt — not a timeout or rate limit

Context

  • Model: claude-opus-4-6
  • The task completed successfully when retried manually via direct gh CLI calls instead of the Task tool
  • usage in response shows total_tokens: 0, tool_uses: 0, duration_ms: 645 — suggesting the subagent never started

Expected behavior

The subagent should launch and execute, or return a more descriptive error if there's a transient issue (with retry guidance).

View original on GitHub ↗

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