Skip to content

Frequent ERR_STREAM_PREMATURE_CLOSE during response streaming and tool execution #25253

@RbBtSn0w

Description

@RbBtSn0w

What happened?

I am experiencing frequent ERR_STREAM_PREMATURE_CLOSE errors while using the Gemini CLI. This error has occurred multiple times
(n times) today during both long response generations and sequences of tool executions. The process terminates abruptly, forcing
me to restart the task.

What did you expect to happen?

I expected the streaming response and tool execution to complete successfully without the stream closing prematurely. The
connection should remain stable throughout long generations, or provide a more resilient recovery mechanism.

Client information

  • CLI Version: 0.37.1
  • Git Commit: 3b2d4f1
  • Session ID: 566b8616-9967-4125-921f-3436d4ac16d9
  • Operating System: darwin v25.8.2
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: oauth-personal
  • Memory Usage: 360.6 MB
  • Terminal Name: tmux 3.6a
  • Terminal Background: #000000
  • Kitty Keyboard Protocol: Unsupported

Login information

Authenticated using oauth-personal.

Anything else we need to know?

  • Error Code: ERR_STREAM_PREMATURE_CLOSE
  • Frequency: Very high (happened numerous times today).
  • Context: The issue seems to trigger more often when the model is generating large amounts of text or when multiple complex
    tools are being called in succession.
  • Note: I am attaching the exported chat history JSON to this issue to help with the investigation of the stream interruption.

Metadata

Metadata

Assignees

Labels

area/coreIssues related to User Interface, OS Support, Core Functionalitytype/bug

Type

No fields configured for Bug.

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions