Add exit code and command output to runInTerminal telemetry#306750
Merged
Add exit code and command output to runInTerminal telemetry#306750
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enriches the toolUse.runInTerminal telemetry event to improve diagnosability of terminal command failures by reporting the numeric exit code and (for MSFT internal users) capturing command output on failure.
Changes:
- Add
exitCodeValuetelemetry field (numeric exit code,-1if unknown). - Add
commandOutputtelemetry field (command output on non-zero exit code; gated to MSFT internal users). - Wire the command output from the tool invocation into the telemetry logger.
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/tools/runInTerminalTool.ts | Passes commandOutput into telemetry state when exitCode is non-zero. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.ts | Adds exitCodeValue and commandOutput to toolUse.runInTerminal telemetry and gates output to internal users. |
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts
Show resolved
Hide resolved
544d269 to
164f69a
Compare
Add exitCodeValue field to the existing toolUse.runInTerminal telemetry event, reporting the actual numeric exit code (-1 if unknown). Previously only a tri-state nonZeroExitCode (0/1/-1) was available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
164f69a to
ff26d2f
Compare
hediet
approved these changes
Mar 31, 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.
Enrich the existing
toolUse.runInTerminaltelemetry event with two new fields:exitCodeValue: The actual numeric exit code of the terminal command (-1 if unknown). Previously only a tri-statenonZeroExitCode(0/1/-1) was reported.commandOutput: The terminal output when a command fails. Only populated for MSFT internal users (CallstackOrExceptionclassification).This enables diagnosing terminal command failures from telemetry data — previously we could tell that a command failed but not why.