[API Error: Premature close]
What happened?
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
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.
same today
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
解决办法:让cli 分步输出到文件,就可以正常执行了。猜测原因:可能就是内容太长了。过程:未知。
gemini-cli对单体大量代码的文件处理能力非常弱,等待了许久最后 报错“[API Error: Premature close]”
@jacob314 Please take a look into this. This is really annoying.
seeing this frequently
same probleam,
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!