Skip to content

Poor Debuggability When Gemini CLI Hangs in Non-Interactive Mode #12163

@gunjanaggarwal-goog

Description

@gunjanaggarwal-goog

What would you like to be added?

When Gemini CLI hangs in non-interactive mode, it is very difficult to debug the root cause. The logs often lack the necessary information to understand what the CLI is doing, which tool it's trying to use, or why it's stuck. This leads to a frustrating and time-consuming debugging experience.

In a recent case, the non-interactive session hanged for more than 15 mins (eventually killed) after printing the following information in the session logs:

Image

Since there is no other information and nothing else was printed in the terminal, we are unable to debug the issue.

Why is this needed?

Improving the debuggability of Gemini CLI in these situations would significantly improve the developer experience. When the CLI hangs, developers need clear and actionable information to quickly diagnose and resolve the problem. The current lack of detailed logging makes it feel like a black box.

Specifically, we propose the following improvements:

  1. Improved Logging: When a tool call is attempted, log the tool name and its parameters, even if the call is not successful or is not on the allowed list. This would have made it immediately obvious which tool was causing the issue.

  2. Timeout for Tool Calls: Implement a timeout for tool calls. If a tool call hangs for an unreasonable amount of time, it should time out with a clear error message. In our case, the tool was hanging for over 15 minutes.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2Important but can be addressed in a future release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions