[BUG] Stream idle timeout / partial response during long tool-use turns on Claude Code Web (Opus 4.7, 1M and non-1M)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- Platform: Claude Code Web (claude.ai/code)
- Model(s) affected:
claude-opus-4-7[1m](1M context) — reproducibleclaude-opus-4-7(standard context) — also reproducible after switching- OS: Linux sandbox (provided by the web harness)
- Session type: long-running conversation with multiple tool calls
(Read / Bash / Grep), working in a git repo
- Approx. transcript length when error first appeared: mid-session,
after several dozen tool calls and a few long assistant messages
Summary
During turns where the assistant is about to produce a long text output
(e.g. drafting a ~400-line markdown design doc after a few Read/Bash
tool calls), the stream terminates with:
API Error: Stream idle timeout - partial response received
The error is not triggered by the tool calls themselves — tool results
arrive normally. It consistently fires in the window between the last
tool result and the start (or middle) of the long text reply.
Reproduction
- Open a Claude Code Web session with Opus 4.7 (1M) on a non-trivial
repo (mine: ~several hundred markdown/py files, custom CLAUDE.md).
- Hold a long design discussion (tens of turns, many Read/Grep/Bash
calls, several multi-paragraph replies).
- Ask the assistant to draft a long markdown document (~400+ lines)
into a file, preceded by 1–2 exploratory tool calls.
- Observe
Stream idle timeout - partial response receivedfire
after the tool calls complete but before / during the long write.
Retry attempts (even after slimming CLAUDE.md and switching fromclaude-opus-4-7[1m] to plain claude-opus-4-7) reproduce the same error.
Actual behavior
Stream aborts mid-turn with an idle timeout; partial response is
discarded from the user's perspective and the Write tool call never
executes. The session is usable afterwards, but the same turn cannot
be completed — it fails repeatedly at roughly the same point.
Impact
- Blocks any workflow that involves drafting a long file in a single
turn (design docs, protocol revisions, report packs).
- Forces the user to manually split work into smaller chunks, losing
the model's ability to produce a coherent document in one pass.
- Switching to the non-1M model does not resolve it, so it does not
appear to be strictly a 1M-context issue.
Workarounds tried (none fully effective)
- Slimmed CLAUDE.md to reduce per-turn context overhead — still fails.
- Switched
claude-opus-4-7[1m]→claude-opus-4-7— still fails. - Starting a fresh session helps temporarily, but the error returns
after the session grows.
Additional context
- The moments when errors occur most frequently are always during the combination of “multi‑turn conversations + about to generate long markdown.”
- The web version cannot call /help, and there is no way to report issues directly from the client, so I am submitting this issue manually.
- Session ID : https://claude.ai/code/session_014AtytC2zxPcAqaoj9LwcGi
Ask
- Is the idle timeout threshold tunable (e.g. via a server-side
setting or client flag)?
- Can the stream be kept alive with heartbeats during long
text generation so long Write tool calls don't get cut off?
- Is there a known interaction between 1M context and long
tail-end text streaming that we should avoid?
What Should Happen?
Expected behavior
The assistant should finish streaming the long reply, or at minimum
fail with a retriable error that preserves the in-progress Write/Edit
tool call.
Error Messages/Logs
API Error: Stream idle timeout - partial response received
Steps to Reproduce
- Open a Claude Code Web session with Opus 4.7 (1M) on a non-trivial
repo (mine: ~several hundred markdown/py files, custom CLAUDE.md).
- Hold a long design discussion (tens of turns, many Read/Grep/Bash
calls, several multi-paragraph replies).
- Ask the assistant to draft a long markdown document (~400+ lines)
into a file, preceded by 1–2 exploratory tool calls.
- Observe
Stream idle timeout - partial response receivedfire
after the tool calls complete but before / during the long write.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Web (claude.ai/code), encountered on 2026-04-17
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
Additional observation (session 014AtytC2zxPcAqaoj9LwcGi, 2026-04-17):
Stream timeout fired during a ~210-line Edit call. The file write
itself completed successfully (verified via git status post-timeout);
only the client-side stream terminated. This suggests the issue is in
keep-alive / heartbeat between tool-result-accepted and next-assistant-
token, not in the tool execution itself.
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗