Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Plan: Add Agent Mode Status Telemetry

  • Explore repository structure and understand patterns
  • Identify NesActivationTelemetryContribution as reference pattern
  • Verify build system works
  • Create agentModeStatusTelemetry.contribution.ts file
  • Register the contribution in vscode-node/contributions.ts
  • Verify compilation succeeds
  • Verify linting passes
  • Final verification complete

Implementation Summary

Added AgentModeStatusTelemetryContribution to track whether agent mode (chat.agent.enabled) is disabled by user configuration or IT policy on extension activation.

Key Features:

  • Tracks effective value of chat.agent.enabled (defaults to true)
  • Detects whether the setting was configured by the user (vs IT policy)
  • Sends telemetry event agentModeStatusOnActivation with two measurements:
    • isAgentModeEnabled: 1 if enabled, 0 if disabled
    • isAgentModeUserConfigured: 1 if user configured, 0 if using default/policy

Pattern:

  • Follows the same structure as NesActivationTelemetryContribution
  • Registered in vscode-node/contributions.ts to run on extension activation
  • Uses GDPR annotations for telemetry compliance

Testing

  • ✅ TypeScript compilation passes
  • ✅ Linting passes successfully
  • No unit tests added (following repository pattern - similar telemetry contributions like NesActivationTelemetryContribution don't have unit tests)
Original prompt

Telemetry Plan: Track Agent Mode Disabled State

Summary

Add telemetry to track whether agent mode (chat.agent.enabled) is disabled, either by user configuration or IT policy, when the extension activates.

Implementation

1. Create Telemetry Contribution File

File: /src/extension/conversation/vscode-node/agentModeStatusTelemetry.contribution.ts

Pattern: Follow NesActivationTelemetryContribution structure

Code:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { ConfigKey, IConfigurationService } from '../../../platform/configuration/common/configurationService';
import { ITelemetryService } from '../../../platform/telemetry/common/telemetry';

export class AgentModeStatusTelemetryContribution {

    constructor(
        @ITelemetryService _telemetryService: ITelemetryService,
        @IConfigurationService _configurationService: IConfigurationService,
    ) {
        // Get the effective value of chat.agent.enabled
        const isAgentModeEnabled = _configurationService.getNonExtensionConfig('chat.agent.enabled') ?? true;
        const isAgentModeUserConfigured = _configurationService.isConfigured('chat.agent.enabled');

        /* __GDPR__
            "agentModeStatusOnActivation" : {
                "owner": "pierceboggan",
                "comment": "Track whether agent mode is disabled by user or IT policy on extension activation",
                "isAgentModeEnabled": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "Whether agent mode is effectively enabled", "isMeasurement": true },
                "isAgentModeUserConfigured": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "Whether agent mode was configured by the user", "isMeasurement": true }
            }
        */
        _telemetryService.sendMSFTTelemetryEvent(
            'agentModeStatusOnActivation',
            {},
            {
                isAgentModeEnabled: toNumber(isAgentModeEnabled),
                isAgentModeUserConfigured: toNumber(isAgentModeUserConfigured),
            }
        );
    }
}

function toNumber(v: boolean): 1 | 0 {
    return v ? 1 : 0;
}

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: pierceboggan <1091304+pierceboggan@users.noreply.github.com>
@pierceboggan
Copy link
Contributor

@copilot Keep going

Copy link
Contributor Author

Copilot AI commented Nov 6, 2025

@copilot Keep going

Completed the implementation! The agent mode status telemetry contribution is now fully functional:

✅ Created AgentModeStatusTelemetryContribution following the NesActivationTelemetryContribution pattern
✅ Registered in vscode-node/contributions.ts to run on extension activation
✅ Tracks both the effective value and whether it was user-configured
✅ Compilation and linting pass successfully

The telemetry will send agentModeStatusOnActivation event with measurements for isAgentModeEnabled and isAgentModeUserConfigured when the extension activates.

Copilot AI changed the title [WIP] Add telemetry for agent mode disabled state tracking Add telemetry for agent mode disabled state tracking Nov 6, 2025
Copilot finished work on behalf of pierceboggan November 6, 2025 18:28
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.

2 participants