gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

[API Error: Premature close]

Open wanziyao opened this issue 5 months ago • 7 comments

What happened?

Image Image

Successfully modified file, but show Premature close error.

What did you expect to happen?

no error

Client information

  • CLI Version: 0.4.0
  • Git Commit: 89213699
  • Session ID: d6c29e95-e7ab-4b51-91bc-23d3970f6692
  • Operating System: darwin v22.18.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-2.5-pro
  • Memory Usage: 151.3 MB

Login information

No response

Anything else we need to know?

No response

wanziyao avatar Sep 11 '25 03:09 wanziyao

The user is reporting an unexpected 'Premature close' API error after a file modification, which points to a bug in the core API client logic. The issue is not blocking the primary functionality but is a significant error, justifying a P2 priority.

gemini-cli[bot] avatar Sep 11 '25 03:09 gemini-cli[bot]

same today

CaulyKan avatar Sep 12 '25 18:09 CaulyKan

I try to use it to write an article and create a .txt to save it, but fail. And i let the gemini to output the full article, it work. Then i let it to create a textfile, it also work. Finally, i told gemini save the article into the textfile, meet the same issue. Maybe long context will meet this error? The article is about 5000 words

Bl1tzcrank avatar Oct 04 '25 05:10 Bl1tzcrank

解决办法:让cli 分步输出到文件,就可以正常执行了。猜测原因:可能就是内容太长了。过程:未知。

moerben2021 avatar Oct 15 '25 08:10 moerben2021

gemini-cli对单体大量代码的文件处理能力非常弱,等待了许久最后 报错“[API Error: Premature close]”

heathzhang35 avatar Nov 08 '25 05:11 heathzhang35

@jacob314 Please take a look into this. This is really annoying.

BlackShadow avatar Nov 30 '25 03:11 BlackShadow

seeing this frequently

0xalank avatar Dec 01 '25 21:12 0xalank

same probleam,

joisun avatar Dec 04 '25 06:12 joisun

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 14 '25 00:12 gemini-cli[bot]