Skip to content

Fix exp id logging#13430

Merged
owenofbrien merged 8 commits intomainfrom
fix_exp_ids
Nov 21, 2025
Merged

Fix exp id logging#13430
owenofbrien merged 8 commits intomainfrom
fix_exp_ids

Conversation

@owenofbrien
Copy link
Copy Markdown
Contributor

@owenofbrien owenofbrien commented Nov 19, 2025

Summary

Fix for broken exp id logging by logging to a new metadata field.

Details

Experiment ids are not flowing through to Concord as expected when logging to LogEvent.exp.gws_experiment (https://source.corp.google.com/piper///depot/google3/wireless/android/play/playlog/proto/clientanalytics.proto;l=235?q=symbol:LogRequest). I tried several approaches but ended up deciding to just log the data to a new metadata field (GEMINI_CLI_EXPERIMENT_IDS).

Related Issues

https://github.com/google-gemini/maintainers-gemini-cli/issues/1070

How to Validate

Pre-Merge Checklist

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

@owenofbrien owenofbrien requested a review from a team as a code owner November 19, 2025 18:44
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @owenofbrien, 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 critical issue where experiment IDs were not being correctly logged to Concord. The fix involves refactoring the telemetry logging mechanism to ensure experiment IDs are properly nested within the LogEvent.exp.gws_experiment field, as required. Additionally, a new metadata key has been introduced for experiment IDs, and the test suite has been updated to align with these changes, ensuring robust and accurate experiment data collection.

Highlights

  • Experiment ID Logging Fix: Corrected the mechanism for logging experiment IDs to Concord, ensuring they are now properly captured within the LogEvent.exp.gws_experiment field.
  • Telemetry Structure Update: Modified the LogEvent and LogEventEntry interfaces in clearcut-logger.ts to reflect the new nested structure for experiment IDs.
  • New Metadata Key: Introduced EventMetadataKey.GEMINI_CLI_EXPERIMENT_IDS to explicitly log experiment IDs as part of event metadata.
  • Test Suite Adjustments: Updated numerous test files across cli and core packages to include a getExperiments mock in their Config objects, accommodating the changes in the ClearcutLogger.
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
Copy Markdown
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 experiment ID logging by moving the gws_experiment field. The changes are mostly correct, but I've identified a critical issue. When no experiments are active, a default experiment ID of 0 is logged, which could corrupt analytics data. This should be changed to an empty array. The other changes, such as updating tests and adding a new metadata key for experiment IDs, are appropriate.

Comment thread packages/core/src/telemetry/clearcut-logger/clearcut-logger.ts Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 19, 2025

Size Change: +1.5 kB (+0.01%)

Total Size: 21.1 MB

Filename Size Change
./bundle/gemini.js 21.1 MB +1.5 kB (+0.01%)
ℹ️ 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

@owenofbrien owenofbrien changed the title Fix exp ids Fix exp id logging Nov 19, 2025
owenofbrien and others added 4 commits November 19, 2025 14:58
…vents were getting logged with empty exp ids because they were firing before the exp ids came back from the server.

- Removed exp ids from gws_experiment field, as for some reason the data isn't flowing through to Concord this way.
@owenofbrien owenofbrien added this pull request to the merge queue Nov 21, 2025
Merged via the queue into main with commit 64eb14a Nov 21, 2025
22 checks passed
@owenofbrien owenofbrien deleted the fix_exp_ids branch November 21, 2025 20:46
thacio added a commit to thacio/auditaria that referenced this pull request Nov 23, 2025
werdnum pushed a commit to werdnum/gemini-cli that referenced this pull request Nov 24, 2025
mboshernitsan pushed a commit that referenced this pull request Nov 25, 2025
danpalmer pushed a commit to danpalmer/gemini-cli that referenced this pull request Nov 29, 2025
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.

2 participants