API Error: Stream idle timeout — partial response received kills long read-only subagents (~6 min), losing their final report

Open 💬 0 comments Opened Jul 9, 2026 by Hllsweb

Bug report

Long-running read-only subagents (adversarial reviewer / planner agents doing many sequential Read/Grep tool calls) intermittently die with:

API Error: Stream idle timeout - partial response received

Observed 3× between 2026-06-18 and 2026-06-22 in one project, always with the same signature: subagent alive ~360s, 12-13 tool uses, then the stream dies and the partial response is discarded — the agent's final report is lost and the whole gate has to be re-run (we now re-run inline as a documented fallback).

Expected: either the stream is kept alive during long tool-use sequences, or the harness retries/resumes the subagent instead of discarding ~6 minutes of work.

Environment: Claude Code CLI 2.1.178+ on macOS, subagents spawned via Task tool and via context: fork skills (custom agent definitions, read-only allowlists, background: true in some cases).

View original on GitHub ↗