Skip to content

Conversation

@gundermanc
Copy link
Member

@gundermanc gundermanc commented Jan 8, 2026

Summary

Adds additional hardware telemetry. Now captures CPU model name, GPU model name, core count, and available RAM.

Note that making the entire stack asynchronous was going to require a significant amount of refactors so for now I use void in loggers.ts to fire and forget without raising a linter error.

Details

The change is separate into commits. The first few are the actual change. The final commit is just the refactors needed to change the logging methods from sync to async.

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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gundermanc, 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 introduces significant enhancements to the application's telemetry system by enabling the collection of detailed hardware specifications. It now gathers information about the CPU (model and core count), total RAM, and GPU, providing a clearer picture of the diverse environments in which the application operates. This data will be instrumental in understanding performance characteristics and optimizing future development.

Highlights

  • Hardware Telemetry Collection: Implemented collection of CPU model, CPU core count, total RAM, and GPU information to enhance telemetry data.
  • Platform-Specific GPU Detection: Added a getGpuInfo function that uses execSync with OS-specific commands to retrieve GPU details for macOS, Linux, and Windows, including error handling.
  • New Telemetry Keys: Introduced new EventMetadataKey enums (GEMINI_CLI_CPU_INFO, GEMINI_CLI_CPU_CORES, GEMINI_CLI_GPU_INFO, GEMINI_CLI_RAM_TOTAL_GB) to categorize the newly collected hardware data.
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 adds telemetry for hardware details like CPU, GPU, and RAM. The implementation has a couple of issues. First, there's a potential TypeError when accessing CPU information if os.cpus() returns an empty array, which would prevent telemetry events from being logged. Second, the hardware information is collected on every single telemetry event, which is inefficient. The getGpuInfo function in particular uses execSync, a blocking call that can cause performance bottlenecks. My review includes suggestions to fix the potential crash and to cache the hardware information to improve performance.

Comment on lines 193 to 222
function getGpuInfo(): string {
try {
switch (process.platform) {
case 'darwin':
return execSync(
'system_profiler SPDisplaysDataType | grep "Chipset Model" | cut -d: -f2 | xargs',
)
.toString()
.trim();
case 'linux':
return execSync(
"lspci | grep -i 'vga\\|3d\\|2d' | head -n 1 | sed 's/.*: //'",
)
.toString()
.trim();
case 'win32':
return execSync('wmic path win32_videocontroller get name')
.toString()
.trim();
default:
return 'NA';
}
} catch (error) {
debugLogger.error(
'Failed to get GPU information for telemetry',
getErrorMessage(error),
);
return 'FAILED';
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Hardware information (CPU, GPU, RAM) is collected on every telemetry event within createBasicLogEvent. This is inefficient, particularly the getGpuInfo function which uses execSync and blocks the main thread, creating a performance bottleneck. Since this hardware information is unlikely to change during the CLI's runtime, it should be collected only once and cached. A good approach would be to gather this information in the ClearcutLogger constructor, store it in private class properties, and reuse it for all events.

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Size Change: +720 kB (+3.23%)

Total Size: 23 MB

Filename Size Change
./bundle/gemini.js 23 MB +720 kB (+3.23%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

@gemini-cli gemini-cli bot added the priority/p1 Important and should be addressed in the near term. label Jan 8, 2026
@gundermanc gundermanc force-pushed the gundermanc/hardware-telemetry branch from 17fc344 to dec5dc9 Compare January 8, 2026 18:41
@gundermanc gundermanc force-pushed the gundermanc/hardware-telemetry branch from e695d88 to 34faa5d Compare January 8, 2026 20:50
@gundermanc gundermanc force-pushed the gundermanc/hardware-telemetry branch from 4ccba63 to 64a1993 Compare January 9, 2026 01:01
@gundermanc gundermanc marked this pull request as ready for review January 9, 2026 01:03
@gundermanc gundermanc requested review from a team as code owners January 9, 2026 01:03
@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1 Important and should be addressed in the near term. status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant