logging compaction telemetry#324773
Draft
aiday-mar wants to merge 2 commits into
Draft
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @anthonykim1Matched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds lightweight telemetry to the terminal chat tool to mark when a run-in-terminal command is one that Copilot CLI would compact the output of. A new logCompactionHint method is added to RunInTerminalToolTelemetry, backed by a compactionHintKeywords list, and it is invoked from RunInTerminalTool on each invocation. It fits into the existing terminal tool telemetry (toolUse.runInTerminal.*) used for feature-insight analysis.
Changes:
- Add
logCompactionHint(command)that checks the command against a keyword list and emits thetoolUse.runInTerminal.compactionDoneevent. - Introduce the
compactionHintKeywordsconstant array. - Call
logCompactionHint(args.command)fromRunInTerminalTool.invoke.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.ts | Adds the logCompactionHint method, telemetry event definition, and the compactionHintKeywords list. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts | Invokes logCompactionHint with the command during tool invocation. |
Key review notes:
- Substring matching (
.includes()) against the whole command line with short/generic keywords (go,nx,uv,node,git,apt,pip,make) will over-count via false positives. - Several hyphenated category-style entries (and
mavenvsmvn) can never match a real command line, and some entries are redundant under substring matching.
Comment on lines
+238
to
+269
| const compactionHintKeywords: readonly string[] = [ | ||
| 'apt', | ||
| 'npm', | ||
| 'npm-pack', | ||
| 'yarn-berry', | ||
| 'pnpm', | ||
| 'composer', | ||
| 'poetry', | ||
| 'pip', | ||
| 'uv', | ||
| 'maven', | ||
| 'dotnet', | ||
| 'python-build', | ||
| 'go', | ||
| 'unittest', | ||
| 'js-test', | ||
| 'cargo', | ||
| 'node', | ||
| 'pytest', | ||
| 'git', | ||
| 'git-clean', | ||
| 'nx', | ||
| 'python-build-ext', | ||
| 'django-test', | ||
| 'golangci-lint', | ||
| 'clang-format-linter', | ||
| 'gradle', | ||
| 'cmake', | ||
| 'make', | ||
| 'shell-grep', | ||
| 'python-script', | ||
| ]; |
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.
No description provided.