Skip to content

Add exit code and command output to runInTerminal telemetry#306750

Merged
isidorn merged 1 commit intomainfrom
isidor/terminal-failure-telemetry
Mar 31, 2026
Merged

Add exit code and command output to runInTerminal telemetry#306750
isidorn merged 1 commit intomainfrom
isidor/terminal-failure-telemetry

Conversation

@isidorn
Copy link
Copy Markdown
Collaborator

@isidorn isidorn commented Mar 31, 2026

Enrich the existing toolUse.runInTerminal telemetry event with two new fields:

  • exitCodeValue: The actual numeric exit code of the terminal command (-1 if unknown). Previously only a tri-state nonZeroExitCode (0/1/-1) was reported.
  • commandOutput: The terminal output when a command fails. Only populated for MSFT internal users (CallstackOrException classification).

This enables diagnosing terminal command failures from telemetry data — previously we could tell that a command failed but not why.

Copilot AI review requested due to automatic review settings March 31, 2026 13:37
@isidorn isidorn self-assigned this Mar 31, 2026
@isidorn isidorn added this to the 1.115.0 milestone Mar 31, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 exitCodeValue telemetry field (numeric exit code, -1 if unknown).
  • Add commandOutput telemetry 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.

@isidorn isidorn force-pushed the isidor/terminal-failure-telemetry branch from 544d269 to 164f69a Compare March 31, 2026 13:47
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>
@isidorn isidorn force-pushed the isidor/terminal-failure-telemetry branch from 164f69a to ff26d2f Compare March 31, 2026 13:58
@isidorn isidorn enabled auto-merge March 31, 2026 13:59
@isidorn isidorn merged commit 6b7cce1 into main Mar 31, 2026
18 checks passed
@isidorn isidorn deleted the isidor/terminal-failure-telemetry branch March 31, 2026 14:18
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.

3 participants