Skip to content

Commit 6b7cce1

Browse files
authored
Merge pull request #306750 from microsoft/isidor/terminal-failure-telemetry
Add exit code and command output to runInTerminal telemetry
2 parents 0e2d1c5 + ff26d2f commit 6b7cce1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export class RunInTerminalToolTelemetry {
128128
requestUnsandboxedExecutionReason: string | undefined;
129129
outputLineCount: number;
130130
nonZeroExitCode: -1 | 0 | 1;
131+
exitCodeValue: number;
131132
timingConnectMs: number;
132133
pollDurationMs: number;
133134
timingExecuteMs: number;
@@ -159,6 +160,7 @@ export class RunInTerminalToolTelemetry {
159160
requestUnsandboxedExecutionReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The reason the model gave for requesting unsandboxed execution, if any' };
160161
outputLineCount: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'How many lines of output were produced, this is -1 when isBackground is true or if there\'s an error' };
161162
nonZeroExitCode: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'Whether the command exited with a non-zero code (-1=error/unknown, 0=zero exit code, 1=non-zero)' };
163+
exitCodeValue: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; isMeasurement: true; comment: 'The actual exit code of the terminal command (-1 if unknown)' };
162164
timingConnectMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'How long the terminal took to start up and connect to' };
163165
timingExecuteMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'How long the terminal took to execute the command' };
164166
pollDurationMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'How long the tool polled for output, this is undefined when isBackground is true or if there\'s an error' };
@@ -187,6 +189,7 @@ export class RunInTerminalToolTelemetry {
187189
requestUnsandboxedExecutionReason: state.requestUnsandboxedExecutionReason,
188190
outputLineCount: state.outputLineCount,
189191
nonZeroExitCode: state.exitCode === undefined ? -1 : state.exitCode === 0 ? 0 : 1,
192+
exitCodeValue: state.exitCode ?? -1,
190193
timingConnectMs: state.timingConnectMs,
191194
timingExecuteMs: state.timingExecuteMs,
192195
pollDurationMs: state.pollDurationMs ?? 0,

0 commit comments

Comments
 (0)