claude-code - 💡(How to fix) Fix Ultraplan: stream timeouts, cache_control on empty blocks, teleport failure [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#50738Fetched 2026-04-20 12:14:25
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.94.content.4.text: cache_control cannot be set for empty text blocks"},"request_id":"req_011CaD9FhG4wEAtfmMwxUygg"}

Code Example

API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.94.content.4.text: cache_control cannot be set for empty text blocks"},"request_id":"req_011CaD9FhG4wEAtfmMwxUygg"}

---

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

Bug Report

Claude Code version: Latest (as of 2026-04-19) Model: Opus 4.7 (web session) Feature: Ultraplan (cloud plan refinement)

What happened

Used ultraplan from CLI to refine a plan file. The web session launched but failed repeatedly:

Error 1: cache_control on empty text blocks

API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.94.content.4.text: cache_control cannot be set for empty text blocks"},"request_id":"req_011CaD9FhG4wEAtfmMwxUygg"}

This happened when the web session tried to update the plan file. Suggests an empty text block in the conversation context is getting cache_control headers.

Error 2: Stream idle timeout (repeated 4x)

API Error: Stream idle timeout - partial response received

Every attempt to write/update the plan file timed out mid-stream. User retried 4+ times, all failed with the same error.

Error 3: Teleport failure

The plan was saved to /root/.claude/plans/here-is-a-draft-proud-tarjan.md on the remote session but the "teleport" mechanism failed to pipe it back to the local CLI session. The web session itself acknowledged: "The 'teleport' phrase I used was the canned response per the plan-mode protocol, but the actual delivery mechanism is whatever your local harness does to pull that file back. Looks like it didn't pipe through."

User was stuck - the refined plan existed only on the remote, with no way to get it back except manually.

Expected behavior

  1. cache_control should not be set on empty text blocks - filter them out before sending
  2. Stream timeouts should have retry/resume logic, especially for plan file writes
  3. Teleport should reliably deliver the plan file back to the local session

Screenshots

User provided 4 screenshots showing the error sequence (available on request).

Impact

Ultraplan was completely unusable for this session. User had to abandon the web refinement and continue in the local CLI. The feature promises "refine plans on the web" but currently fails on non-trivial plans (this plan was ~200 lines).

Environment

  • macOS Darwin 25.4.0
  • Claude Code CLI (local) -> Claude Code Web (remote)
  • Plan file: ~200 lines markdown
  • Context: ~94 messages deep in conversation when ultraplan was invoked

extent analysis

TL;DR

The most likely fix involves modifying the ultraplan feature to filter out empty text blocks before setting cache_control headers and implementing retry logic for stream timeouts to ensure reliable plan file writes and teleport delivery.

Guidance

  • Verify that the ultraplan feature correctly handles empty text blocks by checking the conversation context and filtering out blocks without content before sending them.
  • Implement retry logic for stream timeouts to resume plan file writes and ensure that the teleport mechanism can deliver the refined plan file back to the local CLI session.
  • Review the plan file size and complexity to determine if there are any limitations or optimizations that can be made to improve the refinement process.
  • Check the Claude Code Web and CLI versions to ensure they are compatible and up-to-date, as this may impact the functionality of the ultraplan feature.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The provided information suggests that the issue is related to the ultraplan feature and its interaction with the web session and local CLI. However, without more detailed technical information, it is difficult to provide a comprehensive solution.

Recommendation

Apply a workaround by modifying the ultraplan feature to handle empty text blocks and implement retry logic for stream timeouts, as this is likely to resolve the reported errors and improve the overall functionality of the feature.

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…

FAQ

Expected behavior

  1. cache_control should not be set on empty text blocks - filter them out before sending
  2. Stream timeouts should have retry/resume logic, especially for plan file writes
  3. Teleport should reliably deliver the plan file back to the local session

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING