Skip to content

agent: ignore empty query#485

Merged
droot merged 1 commit into
GoogleCloudPlatform:mainfrom
droot:fix-empty-query-handling
Aug 14, 2025
Merged

agent: ignore empty query#485
droot merged 1 commit into
GoogleCloudPlatform:mainfrom
droot:fix-empty-query-handling

Conversation

@droot
Copy link
Copy Markdown
Member

@droot droot commented Aug 14, 2025

With this PR, agent as well the terminal-ui will ignore empty user queries. Before this PR, we had a bug in the system where empty query will force the agent into an irrecoverable state where it will continue to make LLM request with empty query and keep on causing 400: invalid argument LLM API error.

And it is easy to get in this state especially when you are waiting for LLM to respond and end up pressing "ENTER" with no input.

An example:

>>>
E0813 21:27:30.319436   66139 conversation.go:501] "error reading streaming LLM response" err=<
        Error 400, Message: * GenerateContentRequest.contents[157].parts[0].data: required oneof field 'data' must have one initialized field
        , Status: INVALID_ARGUMENT, Details: []
 >
E0813 21:27:30.319541   66139 conversation.go:538] "error streaming LLM response" err=<
        Error 400, Message: * GenerateContentRequest.contents[157].parts[0].data: required oneof field 'data' must have one initialized field
        , Status: INVALID_ARGUMENT, Details: []
 >
Error: Error 400, Message: * GenerateContentRequest.contents[157].parts[0].data: required oneof field 'data' must have one initialized field

I will cut another release once this gets merged.

/cc @noahlwest @ShubyM

Copy link
Copy Markdown
Collaborator

@noahlwest noahlwest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@droot droot merged commit f151614 into GoogleCloudPlatform:main Aug 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants