Skip to content

feat(telemetry): include language in telemetry and fix accepted lines computation#21126

Merged
gundermanc merged 3 commits intomainfrom
gundermanc/telemetry-updates
Mar 4, 2026
Merged

feat(telemetry): include language in telemetry and fix accepted lines computation#21126
gundermanc merged 3 commits intomainfrom
gundermanc/telemetry-updates

Conversation

@gundermanc
Copy link
Member

@gundermanc gundermanc commented Mar 4, 2026

Summary

Include language in telemetry and do not send non-edit events. Additionally, fixes accepted lines computation.

Details

  • Added language information to telemetry events.
  • Filtered out non-edit events to reduce noise in telemetry.
  • Fixed the logic for computing accepted lines.

Related Issues

N/A

How to Validate

  1. Run the application with telemetry enabled.
  2. Verify that telemetry events include language data.
  3. Verify that non-edit events are not sent.
  4. Verify that accepted lines are computed correctly.

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

@gundermanc gundermanc requested a review from a team as a code owner March 4, 2026 17:50
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Size Change: +1.08 kB (0%)

Total Size: 25.9 MB

Filename Size Change
./bundle/gemini.js 25.5 MB +1.08 kB (0%)
ℹ️ View Unchanged
Filename Size
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 significantly refines the telemetry system by integrating programming language data into relevant events and streamlining the event capture process to focus exclusively on file modification actions. It also addresses a critical correction in how accepted lines are calculated, leading to more accurate and insightful data collection for code assist features.

Highlights

  • Telemetry Enhancement: Language Inclusion: Programming language information is now included in telemetry events for file modification operations, providing richer context for code assist interactions.
  • Telemetry Filtering: Non-Edit Events: Telemetry events are now filtered to only record interactions that involve actual file editing tools, reducing noise and focusing on actionable suggestions.
  • Telemetry Correction: Accepted Lines Calculation: The computation for 'acceptedLines' in telemetry has been corrected to accurately sum both added and removed lines, ensuring more precise metrics.
  • Type Safety: New Type Guards: New type guard functions, isEditToolParams and isWriteFileToolParams, were introduced to improve type safety when handling tool parameters.
Changelog
  • packages/core/src/code_assist/telemetry.test.ts
    • Updated mock tool names from generic 'tool' or 'someTool' to 'replace' for consistency in tests.
    • Added new test cases to verify that language information is correctly included in telemetry interactions.
    • Introduced tests to confirm that non-edit events are no longer recorded in telemetry.
    • Adjusted the expected value for 'acceptedLines' in a test to reflect the updated calculation logic.
  • packages/core/src/code_assist/telemetry.ts
    • Implemented logic to extract and include the programming language in telemetry events based on the file path of the modified file.
    • Modified the createConversationOffered function to only generate telemetry events for responses that contain actual file editing function calls.
    • Updated the summarizeToolCalls function to correctly calculate acceptedLines by summing both added and removed lines.
    • Refined the condition for recording conversation interactions to ensure only accepted edit tool calls are logged, removing the 'UNKNOWN' interaction type for non-edit tools.
    • Imported isEditToolParams and isWriteFileToolParams for type checking tool arguments.
  • packages/core/src/tools/edit.ts
    • Added the isEditToolParams type guard function to validate the structure of edit tool parameters.
  • packages/core/src/tools/write-file.ts
    • Added the isWriteFileToolParams type guard function to validate the structure of write file tool parameters.
Activity
  • The author, gundermanc, initiated this pull request to enhance telemetry data collection and correct an existing calculation.
  • The pull request introduces changes across core telemetry logic, tool parameter validation, and corresponding unit tests.
  • The pre-merge checklist indicates that new/updated tests have been added and validated on MacOS.
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 introduces several improvements to the telemetry system. It adds language detection for edit-related tool calls, which will provide more granular data. It also correctly filters out non-edit events, reducing noise and focusing telemetry on file modifications. Additionally, it fixes a bug in the computation of accepted lines, ensuring more accurate metrics. The changes are well-implemented, tested, and improve the overall quality of the telemetry data. I have no specific concerns with this implementation.

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 4, 2026
@gundermanc gundermanc enabled auto-merge March 4, 2026 18:44
@gundermanc gundermanc added this pull request to the merge queue Mar 4, 2026
Merged via the queue into main with commit 49e4082 Mar 4, 2026
27 checks passed
@gundermanc gundermanc deleted the gundermanc/telemetry-updates branch March 4, 2026 19:16
BryanBradfo pushed a commit to BryanBradfo/gemini-cli that referenced this pull request Mar 5, 2026
struckoff pushed a commit to struckoff/gemini-cli that referenced this pull request Mar 6, 2026
kunal-10-cloud pushed a commit to kunal-10-cloud/gemini-cli that referenced this pull request Mar 12, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
yashodipmore pushed a commit to yashodipmore/geemi-cli that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants