[API Error: * CountTokensRequest.contents[2].parts[0].data: required oneof field 'data' must have one initialized field (Status: INVALID_ARGUMENT)]
What happened?
When i try to compress chat history it shows this error:
Failed to compress chat history: {"error":{"code":400,"message":"* CountTokensRequest.contents[2].parts[0].data: required one of field 'data' must have one initialized field\n","status":"INVALID_ARGUMENT"}}
also
After i resume chat history, gemini cli resumes history but after that any commands throws this error:
[API Error: * CountTokensRequest.contents[2].parts[0].data: required oneof field 'data' must have one initialized field (Status: INVALID_ARGUMENT)]
This happened after i have updated to 0.1.16 from 0.1.15. i have also noticed that in my google cloud api console, before the update gemini 2.5 flash was used for compressing and after the update, gemini 2.5 flash lite was used. i am not sure about this , but this might be a issue.
What did you expect to happen?
It compresses the history like before and I can chat normally.
Client information
CLI Version 0.1.16
Git Commit 820169ba (local modifications)
Model gemini-2.5-pro
Sandbox no sandbox
OS win32
Auth Method gemini-api-key
Login information
Logging in with Gemini API key
Anything else we need to know?
No response
I faced this as well today
Failed to compress chat history: {"error":{"code":400,"message":"* CountTokensRequest.contents[2].parts[0].data: required oneof field 'data' must have one initialized field\n","status":"INVALID_ARGUMENT"}}
For visibility, I'm mentioning my analysis from issue #5592 here.
This appears to have been addressedin #5592 Please don't hesitate to let us know if you are still seeing this issue.