Skip to content

Conversation

@sigmaSd
Copy link

@sigmaSd sigmaSd commented Jan 24, 2026

Summary

Fix an issue where GC shows an error when starting in termux

This happens because os.cpus() returns an empty array in termux

Details

Related Issues

Fixes #17456

How to Validate

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@sigmaSd sigmaSd requested a review from a team as a code owner January 24, 2026 19:56
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @sigmaSd, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a startup error encountered in specific environments, such as Termux, where the system's CPU information might not be readily available. By introducing a more resilient way to access CPU details, the change ensures that the application can start without crashing, even when complete CPU model data cannot be retrieved.

Highlights

  • Error Prevention: Implemented optional chaining to safely access CPU model information, preventing errors when os.cpus() returns an empty array, particularly in environments like Termux.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix a crash that occurs when os.cpus() returns an empty array, which can happen in environments like Termux. The change correctly uses optional chaining to prevent the immediate crash. However, this can result in an undefined value being assigned to a property that expects a string, which could lead to downstream errors. I've suggested a small change to provide a fallback value to ensure type safety and robustness.

{
gemini_cli_key: EventMetadataKey.GEMINI_CLI_CPU_INFO,
value: cpus[0].model,
value: cpus[0]?.model,
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

While using optional chaining (?.) correctly prevents a crash when os.cpus() returns an empty array, the expression cpus[0]?.model can evaluate to undefined. The value property of the EventValue interface is typed as string, so assigning undefined to it can lead to type errors or unexpected behavior downstream. It's safer to provide a fallback value to ensure type safety, similar to other properties in this file.

Suggested change
value: cpus[0]?.model,
value: cpus[0]?.model ?? '',

@gemini-cli
Copy link
Contributor

gemini-cli bot commented Jan 27, 2026

Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request.

To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues.

If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding!

@gemini-cli gemini-cli bot closed this Jan 27, 2026
@sigmaSd
Copy link
Author

sigmaSd commented Jan 27, 2026

It's only a couple of days not 30 days is this a bug

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.

GC shows an error when starting in termux

2 participants