fix(analytics): fix Gemini agent analytics tracking (EPMCDME-14674) - #528
Merged
yanaSelin merged 3 commits intoSep 4, 2026
Merged
Conversation
yanaSelin
reviewed
Sep 4, 2026
yanaSelin
reviewed
Sep 4, 2026
…analytics (EPMCDME-14674)
yanaSelin
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
EPMCDME-14674
Summary
When running codemie analytics --report --last 8d, users utilizing Gemini agents received "No analytics data available". This PR resolves parsing, deduplication, and attribution gaps for Gemini CLI transcripts:
ead, delete) and extracted line counts across varied argument schemas.
Verification
pm run test:unit)
pm run build compiled successfully
Note on MCP Tool Mapping & Proposed Follow-Up (Technical Debt)
In this PR, I added explicit mappings for Serena MCP tools (
mcp_serena_*) because Serena was the specific MCP server utilized in my Gemini CLI workflows where the missing file operation metrics were identified.Known Limitation & Technical Debt:
Hardcoding specific MCP server names (
mcp_serena_*) solves the immediate issue for this stack, but it introduces technical debt: developers or external contributors using alternative MCP servers (such as@modelcontextprotocol/server-filesystemor custom IDE MCP extensions) will have their tool calls recorded in general usage tables, but their file edits and line diffs will be omitted unless explicitly mapped.Proposed Solution (Universal / MCP-Agnostic Extraction):
I propose creating a follow-up task/PR to make file operation extraction truly generic and MCP-agnostic by:
toolName.replace(/^mcp_[a-z0-9_-]+_/i, '')), so thatmcp_serena_write_file,mcp_filesystem_write_file, and nativewrite_fileall resolve to a common canonical name./write|create/,/replace|edit|patch/,/read|view/,/delete/) and resolving file paths/diffs across standard argument conventions (path,filePath,relative_path,content,replacement,needle/repl).This will ensure that any current or future MCP coding server works out of the box with zero manual config required.