claude-code - 💡(How to fix) Fix [BUG] Sub-agent stream-idle timeout: next API round-trip never starts mid-conversation, no v2.1.105 watchdog retry [1 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#50802Fetched 2026-04-20 12:12:40
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

API Error: Stream idle timeout - partial response received

Root Cause

  • I have searched existing issues — closest match is #46987 (commented). Filing a separate report because the failure mode is sub-agent specific and the v2.1.105 watchdog isn't engaging.
  • This is a single bug report.
  • I am using the latest version of Claude Code.

Code Example

API Error: Stream idle timeout - partial response received
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues — closest match is #46987 (commented). Filing a separate report because the failure mode is sub-agent specific and the v2.1.105 watchdog isn't engaging.
  • This is a single bug report.
  • I am using the latest version of Claude Code.

What's Wrong?

Background sub-agents launched via the Task tool stall mid-conversation, then ~10 minutes later die with API Error: Stream idle timeout - partial response received. The 5-minute idle-stream watchdog added in v2.1.105 doesn't engage in any of the cases observed today.

What Should Happen?

Either the watchdog fires at ~5 min and retries in non-streaming mode (as documented), or the request completes normally. Currently it does neither — the agent silently freezes for 5–10 min, then errors with no retry, losing all in-progress work.

Error Messages/Logs

API Error: Stream idle timeout - partial response received

No retry attempt visible in the sub-agent JSONL.

Steps to Reproduce

  1. Spawn a long-running sub-agent (Task tool, background) on a non-trivial review or analysis prompt expected to make 30+ tool calls and run 5–15 min.
  2. Observe the sub-agent JSONL grow normally for 5–10 min, then stop appending.
  3. The last JSONL entry is consistently an assistant text turn ending with the model declaring its next action (e.g. "now let me write the report sections"), with no subsequent tool_use block.
  4. After ~3–6 min of silence, the agent dies with the stream-idle timeout error.

Observations

  • Sub-agent context (Task tool) only — main session unaffected.
  • Pattern reproducible across prompts. ~10 sub-agent runs today (Sunday 19 April), 50–60% failure rate.
  • Sequential vs parallel doesn't fully fix it — sequential reduces but doesn't eliminate.
  • Failure mode is consistent: API round-trip after a clean assistant text turn never starts (or never returns). Not a hung tool call.
  • Same prompts ran cleanly last night (18 April evening) — started failing today.
  • Status page reported all components operational throughout. Real-world degraded.
  • Hypothesis: weekend deploy or post-15-April-outage aftershock. Sunday low-traffic / typical maintenance window correlation.
  • Cost so far: ~half a 5-hour usage window burned on retried sub-agents.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version (last night, 18 April 2026 evening, same prompts).

extent analysis

TL;DR

The sub-agent watchdog fails to engage, causing background sub-agents to stall and die with a stream idle timeout error, suggesting a potential issue with the watchdog implementation or the API's handling of long-running requests.

Guidance

  • Investigate the differences in the environment or configuration between the previous night (18 April 2026 evening) and the current day (19 April) to identify potential causes for the regression.
  • Review the implementation of the 5-minute idle-stream watchdog added in v2.1.105 to ensure it is correctly engaging for background sub-agents launched via the Task tool.
  • Verify that the API is correctly handling long-running requests and that the stream idle timeout error is not being triggered prematurely.
  • Consider temporarily reducing the number of tool calls or the complexity of the prompts to see if it mitigates the issue.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a relevant example.

Notes

The issue seems to be specific to the Opus Claude Model and the Task tool, and the failure mode is consistent across different prompts. The fact that the same prompts worked cleanly the previous night suggests a potential regression or environmental change.

Recommendation

Apply workaround: Implement a temporary reduction in the number of tool calls or prompt complexity to mitigate the issue while further investigation is conducted. This is recommended because it may help identify the root cause of the problem and prevent further losses due to retried sub-agents.

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