Skip to content

Conversation

@ibezgin-bc
Copy link
Contributor

Problem
The Gemini CLI command was stopping early when capturing output using direct shell command substitution ($(gemini ...)), likely due to buffering issues or incomplete output capture.

Solution
Replaced the direct command substitution with a more robust approach:

Temporary file capture: Uses mktemp to create a temporary file for capturing the full output
Explicit error handling: Added proper exit code checking to distinguish between success and failure
Complete output capture: Captures both stdout and stderr (2>&1) to ensure no output is lost
Proper cleanup: Temporary files are cleaned up after use

@google-cla
Copy link

google-cla bot commented Aug 13, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@leehagoodjames
Copy link
Contributor

@gemini-cli /review

Copy link
Contributor

@gemini-cli gemini-cli bot left a comment

Choose a reason for hiding this comment

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

I've reviewed the changes and left one suggestion to improve the robustness of the script. Overall, the change is a good improvement to fix the output interruption issue.

@sethvargo
Copy link
Contributor

@leehagoodjames - I think this is actually why the CLI is hanging.

sethvargo added a commit that referenced this pull request Aug 13, 2025
Incorporates parts of #176, but uses `$RUNNER_TEMP` and groups the
Gemini CLI output.

Closes #176

---------

Co-authored-by: Yuri Bezgin <ibezgin@blockchain.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants